/* ساعت مطالعه و لیدربرد — همان زبان بصری سایت */

.study-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.study-head h2 { margin: 0; }
.study-head p {
  margin: 8px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: var(--fs-small);
}

.study-title { margin-bottom: var(--sp-5); }
.study-timer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.study-timer,
.study-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}
.study-timer { padding: clamp(20px, 3vw, 36px); }
.study-card { padding: var(--sp-5); }
.study-card + .study-card { margin-top: var(--sp-4); }

.study-modes,
.study-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.study-modes button,
.study-presets button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: var(--fs-caption);
  font-weight: 600;
  cursor: pointer;
}
.study-modes button[aria-checked="true"],
.study-presets button[aria-pressed="true"] {
  background: var(--cyan-tint);
  border-color: var(--accent-line);
  color: var(--accent-deep);
}
.study-modes button:disabled,
.study-presets button:disabled {
  opacity: 0.55;
  cursor: default;
}
.study-presets { margin-top: 12px; }
.study-modes button,
.study-presets button {
  flex: 1 1 9.5rem;
  text-align: center;
}
.study-timer [hidden],
.study-presets[hidden],
.study-confirm[hidden],
.study-lock[hidden],
.study-note[hidden],
.study-me-line[hidden],
.study-status:empty {
  display: none !important;
}
.study-face,
.study-lock-face {
  position: relative;
  display: grid;
  place-items: center;
  container-type: inline-size;
}
.study-face {
  margin: 28px auto 8px;
  width: min(280px, 78%);
  aspect-ratio: 1;
}
.study-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transform-origin: center;
}
.study-ring-track,
.study-ring-value {
  fill: none;
  stroke-width: 6;
}
.study-ring-track { stroke: var(--surface); }
.study-ring-value {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
}
.study-timer.is-break .study-ring-value,
.study-lock.is-break .study-ring-value { stroke: var(--warn); }
.study-timer.is-running .study-ring-value,
.study-lock.is-running .study-ring-value {
  stroke: var(--accent);
}
.study-face-copy,
.study-lock-copy {
  position: relative;
  z-index: 1;
  width: 74%;
  text-align: center;
}
.study-phase {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: 700;
}
.study-time {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 22cqi, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.study-timer.is-paused .study-time { color: var(--muted); }

.study-note {
  margin: 8px 0 0;
  text-align: center;
  color: var(--accent-deep);
  font-size: var(--fs-small);
  font-weight: 600;
}
.study-actions,
.study-confirm div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.study-actions .btn,
.study-confirm .btn {
  flex: 1 1 8.5rem;
  justify-content: center;
  min-width: 0;
}
.study-stop { color: var(--danger); border-color: transparent; }
.study-confirm {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-m);
  background: var(--paper-warm);
  text-align: center;
}
.study-confirm p { margin: 0; font-weight: 700; color: var(--ink); }
.study-fine,
.study-status {
  margin: 16px 0 0;
  text-align: center;
  color: var(--faint);
  font-size: var(--fs-caption);
  line-height: 1.7;
}
.study-status:not(:empty) { display: block; }
.study-status.is-error { color: var(--danger); }

.study-report { margin-top: 36px; }
.study-report-head { margin-bottom: 14px; }
.study-report-head .caption { margin-top: 6px; }
.study-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.study-stats article,
.study-report-card,
.study-setting {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.study-stats article { padding: 16px; min-width: 0; }
.study-stats span {
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: 700;
}
.study-stats strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 900;
  line-height: 1.35;
  color: var(--ink);
}
.study-stats small {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: var(--fs-caption);
  line-height: 1.6;
}
.study-report-card { margin-top: 10px; padding: 18px; }
.study-insight {
  margin: 16px 0 0;
  color: var(--ink-2);
  line-height: 1.8;
}
.study-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}
.study-facts div {
  padding: 12px;
  border-radius: var(--r-s);
  background: var(--paper-warm);
}
.study-facts dt {
  color: var(--muted);
  font-size: var(--fs-caption);
}
.study-facts dd {
  margin: 4px 0 0;
  font-weight: 800;
  color: var(--ink);
}
.study-day.is-today small { color: var(--accent-deep); }
.study-setting {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}
.study-setting h3 {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 800;
}
.study-setting p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-caption);
  line-height: 1.7;
}
.study-switch {
  flex: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  min-width: 5.5rem;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.study-switch[aria-checked="true"] {
  background: var(--cyan-tint);
  border-color: var(--accent-line);
  color: var(--accent-deep);
}

.study-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.study-card-head h3 {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 800;
  color: var(--ink);
}
.study-card-head span,
.study-card-head a {
  color: var(--muted);
  font-size: var(--fs-caption);
}
.study-card-head a { color: var(--accent-deep); font-weight: 700; }
.study-total {
  margin: 14px 0 0;
  font-size: clamp(1.6rem, 2vw, 2rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}
.study-rank {
  margin: 6px 0 0;
  color: var(--accent-deep);
  font-size: var(--fs-small);
  font-weight: 700;
}
.study-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 0;
}
.study-metrics div {
  padding: 12px;
  border-radius: var(--r-s);
  background: var(--paper-warm);
}
.study-metrics dt {
  color: var(--muted);
  font-size: var(--fs-caption);
}
.study-metrics dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}

.study-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 18px;
  height: 96px;
}
.study-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
}
.study-bar {
  flex: 1;
  width: 100%;
  max-width: 18px;
  border-radius: 999px;
  background: var(--surface);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.study-bar i {
  display: block;
  width: 100%;
  height: 0;
  border-radius: 999px;
  background: linear-gradient(to top, var(--accent-deep), var(--accent));
}
.study-day small {
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
}

.study-mini {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.study-mini li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-caption);
}
.study-mini-empty {
  display: block !important;
  color: var(--muted);
  line-height: 1.7;
}
.study-mini-rank {
  font-weight: 800;
  color: var(--faint);
}
.study-mini-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}
.study-mini-time { color: var(--muted); white-space: nowrap; }
.study-mini em,
.study-board-name em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-deep);
  margin-inline-start: 6px;
}
.study-mini .is-me { background: var(--cyan-tint); border-radius: 10px; padding: 6px; }
.study-me-line {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: var(--fs-caption);
  font-weight: 700;
}

.study-lock {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vh, 48px);
  padding:
    max(24px, env(safe-area-inset-top))
    20px
    max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 42%, rgba(3, 200, 255, 0.12), transparent 42%),
    #071018;
  color: #f7fbfd;
  text-align: center;
}
.study-lock[hidden] { display: none !important; }
body.is-focus-lock { overflow: hidden; }
.study-lock-face {
  width: min(78vw, 420px);
  aspect-ratio: 1;
}
.study-lock .study-ring-track { stroke: rgba(255, 255, 255, 0.12); }
.study-lock-phase {
  margin: 0;
  color: #9eb4c2;
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  font-weight: 700;
}
.study-lock-time {
  margin: 8px 0 0;
  color: #f7fbfd;
  font-size: clamp(2.4rem, 16cqi, 4.6rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.study-hold {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: min(100%, 260px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e4ec;
  border-radius: var(--r-pill);
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.study-hold-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: calc(var(--hold, 0) * 100%);
  background: rgba(3, 200, 255, 0.38);
  z-index: -1;
}

.study-public.container { max-width: 760px; }
.study-board-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.study-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.study-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.study-live i,
.study-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(3, 200, 255, 0.55);
  animation: study-live 1.8s ease-out infinite;
  flex: none;
}
.study-live-dot {
  display: inline-block;
  margin-inline-end: 8px;
  vertical-align: middle;
}
.study-ranges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.study-ranges a {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: var(--fs-caption);
  font-weight: 700;
}
.study-ranges a[aria-current="true"] {
  background: var(--cyan-tint);
  border-color: var(--accent-line);
  color: var(--accent-deep);
}
.study-board {
  list-style: none;
  margin: 0;
  padding: 0;
}
.study-board-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.study-board-row:last-child { border-bottom: 0; }
.study-board-row.is-first { background: var(--cyan-tint); }
.study-board-row.is-first .study-board-rank { color: var(--accent-deep); }
.study-board-row.is-me .study-board-name { color: var(--accent-deep); }
.study-board-rank {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--faint);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.study-board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}
.study-board-time {
  color: var(--ink-2);
  font-weight: 700;
  font-size: var(--fs-small);
  white-space: nowrap;
}
.study-board-empty { padding: 28px 18px; text-align: center; }
.study-board-empty h2 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--ink);
}
.study-board-empty p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.study-board-me {
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--ink);
}

@keyframes study-live {
  70% { box-shadow: 0 0 0 8px rgba(3, 200, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(3, 200, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .study-live i,
  .study-live-dot { animation: none; }
}

@media (max-width: 900px) {
  .study-head { flex-direction: column; }
}

@media (max-width: 640px) {
  .study-timer { padding: 16px; }
  .study-face { width: min(240px, 86%); margin-top: 20px; }
  .study-actions,
  .study-confirm div { gap: 8px; }
  .study-board-toolbar { align-items: stretch; flex-direction: column; }
  .study-ranges a { flex: 1 1 0; text-align: center; }
  .study-board-row { padding: 14px 16px; gap: 10px; }
  .study-board-time { font-size: var(--fs-caption); }
  .study-lock-face { width: min(86vw, 360px); }
  .study-stats,
  .study-facts { grid-template-columns: 1fr; }
  .study-setting { align-items: stretch; flex-direction: column; }
}
