/* yp-cards.css v2: subject cards for the YKS and LGS planners, in the style of the owner's mockup
   (2026-10-31). Visual layer only: no markup, script, data, card width or 3D transform changes.
   Selectors start with "html:root body .subject-card" so they win over the older layers
   (page styles, odp-workspace-glow.css, ÖDP linked mode) without touching anything outside the cards. */

/* Zero-width "(" and ")": the completion age reads "168 gün önce bitti" inside its chip. */
@font-face {
  font-family: 'ypc-hide-parens';
  src: url(data:font/ttf;base64,AAEAAAAKAIAAAwAgT1MvMkUHQo0AAAEoAAAAYGNtYXAADAB8AAABkAAAADRnbHlmAAAAAAAAAcwAAAABaGVhZC0tmfYAAACsAAAANmhoZWEDIf86AAAA5AAAACRobXR4AAAAAAAAAYgAAAAIbG9jYQAAAAAAAAHEAAAACG1heHAABAACAAABCAAAACBuYW1lFqRIQgAAAdAAAAB4cG9zdAAQAAwAAAJIAAAAKAABAAAAAQAAjWJT2l8PPPUAAwPoAAAAAOcLrIsAAAAA5wusiwAAAAAAAAAAAAAAAwACAAAAAAAAAAEAAAMg/zgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAEAAAADAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwAAAZAABQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAPz8/PwAAACgAKQMgAAAAAAMgAMgAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAIAAAADAAAAFAADAAEAAAAUAAQAIAAAAAQABAABAAAAKf//AAAAKP///9kAAQAAAAAAAAAAAAAAAAAAAAAAAAAEADYAAQAAAAAAAQAPAAAAAQAAAAAAAgAHAA8AAwABBAkAAQAeABYAAwABBAkAAgAOADR5cGMtaGlkZS1wYXJlbnNSZWd1bGFyAHkAcABjAC0AaABpAGQAZQAtAHAAYQByAGUAbgBzAFIAZQBnAHUAbABhAHIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAACwAM) format('truetype');
  unicode-range: U+0028-0029;
  font-display: block;
}

html:root body .subject-card {
  --ypc-ink: #1b1740;
  --ypc-ink-2: #2b2f45;
  --ypc-text: #475069;
  --ypc-muted: #6b7189;
  --ypc-line: #ebe8f6;
  --ypc-violet: #6d28d9;
  --ypc-violet-2: #7c3aed;
  --ypc-lav: #c4b5fd;
  --ypc-lav-2: #ddd6fe;
  --ypc-lav-bg: #f4f1ff;
  --ypc-green: #15803d;
  --ypc-font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, #ffffff 0%, #f8f6ff 55%, #f2f5ff 100%) !important;
  border: 1px solid rgba(255, 255, 255, .95) !important;
  border-radius: 26px !important;
  box-shadow: 0 0 0 1px rgba(109, 40, 217, .07), 0 1px 0 rgba(255, 255, 255, .9) inset,
    0 24px 50px -24px rgba(49, 26, 120, .35) !important;
  font-family: var(--ypc-font);
  color: var(--ypc-ink-2);
}
html:root body .subject-card::before,
html:root body .subject-card::after { display: none !important; }
/* 3D view: the front card keeps its accent halo, a little softer. */
html:root body .subject-grid.yp-orbit > .subject-card[data-yp-orbit='front'] {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7),
    0 0 0 5px color-mix(in srgb, var(--yp-orbit-accent, #8b5cf6) 18%, transparent),
    0 34px 80px -28px color-mix(in srgb, var(--yp-orbit-accent, #8b5cf6) 55%, transparent),
    0 18px 40px rgba(2, 6, 23, .38) !important;
}
@media (hover: hover) {
  html:root body .subject-grid:not(.yp-orbit) > .subject-card:hover {
    box-shadow: 0 0 0 1px rgba(109, 40, 217, .1), 0 1px 0 rgba(255, 255, 255, .9) inset,
      0 30px 60px -26px rgba(49, 26, 120, .42) !important;
  }
}

/* ---------- Header: icon tile, title, section ---------- */
html:root body .subject-card .subject-header { margin-bottom: 12px !important; gap: 12px !important; }
html:root body .subject-card .subject-title { gap: 10px 12px !important; margin-bottom: 4px !important; align-items: center !important; }
html:root body .subject-card .subject-title-text {
  display: inline-block !important; font-family: var(--ypc-font) !important;
  font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.02em !important;
  line-height: 1.15 !important; color: var(--ypc-ink) !important; padding-top: 2px !important; min-height: 56px !important;
}
/* The subject emoji becomes the icon tile. */
html:root body .subject-card .subject-title-text::first-letter {
  float: left; font-size: 26px; line-height: 50px; padding: 0 12px; margin: 0 14px 0 0;
  border-radius: 16px; color: inherit !important;
  background: linear-gradient(150deg, #ffffff 0%, #efeaff 100%) !important;
  border: 1px solid #e6e0fb;
  box-shadow: 0 8px 18px -8px rgba(91, 33, 182, .4), 0 1px 0 #fff inset !important;
}
html:root body .subject-card .subject-title-text::after {
  display: block; margin-top: 5px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ypc-muted);
}
html:root body #tyt-subjects > .subject-card .subject-title-text::after { content: 'TYT'; }
html:root body #ayt-subjects > .subject-card .subject-title-text::after { content: 'AYT'; }
html:root body #msu-subjects > .subject-card .subject-title-text::after { content: 'MSÜ'; }
html:root body #sayisal-subjects > .subject-card .subject-title-text::after { content: 'LGS · Sayısal'; }
html:root body #sozel-subjects > .subject-card .subject-title-text::after { content: 'LGS · Sözel'; }
html:root body .subject-card .subject-title-actions { gap: 8px !important; }

/* Pills: "7 tekrar" and "Soru Dağılımı + Çıkmış Sorular →" */
html:root body .subject-card .subject-review-btn,
html:root body .subject-card .dist-btn {
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
  height: 38px !important; min-height: 38px !important; padding: 0 16px !important; border-radius: 999px !important;
  font-family: var(--ypc-font) !important; font-size: 13.5px !important; font-weight: 700 !important;
  letter-spacing: -.005em !important; line-height: 1 !important; white-space: nowrap !important; text-transform: none !important;
  transform: none !important; cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease !important;
}
html:root body .subject-card .dist-btn {
  background: #fff !important; color: var(--ypc-ink) !important; border: 1px solid var(--ypc-lav-2) !important;
  box-shadow: 0 4px 12px -6px rgba(49, 26, 120, .18) !important;
}
html:root body .subject-card .dist-btn::after {
  content: ''; width: 15px; height: 15px; flex: 0 0 15px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
html:root body .subject-card .dist-btn:hover { border-color: var(--ypc-lav) !important; color: var(--ypc-violet) !important; box-shadow: 0 6px 16px -6px rgba(109, 40, 217, .3) !important; background: #fff !important; }
html:root body .subject-card .dist-btn--msu { color: #0f766e !important; }
html:root body .subject-card .subject-review-btn > span[aria-hidden='true'] { display: none !important; }
html:root body .subject-card .subject-review-btn::before {
  content: '' !important; width: 17px; height: 17px; flex: 0 0 17px; background: var(--ypc-bell, #f97316);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5a6.5 6.5 0 0 0-6.5 6.5v3.6l-1.7 3a1 1 0 0 0 .87 1.5h14.66a1 1 0 0 0 .87-1.5l-1.7-3V9A6.5 6.5 0 0 0 12 2.5Zm-2.6 16.6a2.7 2.7 0 0 0 5.2 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5a6.5 6.5 0 0 0-6.5 6.5v3.6l-1.7 3a1 1 0 0 0 .87 1.5h14.66a1 1 0 0 0 .87-1.5l-1.7-3V9A6.5 6.5 0 0 0 12 2.5Zm-2.6 16.6a2.7 2.7 0 0 0 5.2 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
html:root body .subject-card .subject-review-btn.is-danger { --ypc-bell: #f97316; background: #fff1ee !important; color: #c81e1e !important; border: 1px solid #ffd8cf !important; box-shadow: 0 6px 14px -8px rgba(220, 38, 38, .45) !important; }
html:root body .subject-card .subject-review-btn.is-warning { --ypc-bell: #f59e0b; background: #fff8e8 !important; color: #b45309 !important; border: 1px solid #fde4a8 !important; box-shadow: 0 6px 14px -8px rgba(217, 119, 6, .4) !important; }
html:root body .subject-card .subject-review-btn.is-success { --ypc-bell: #10b981; background: #edfbf4 !important; color: #047857 !important; border: 1px solid #c4f0da !important; box-shadow: 0 6px 14px -8px rgba(5, 150, 105, .35) !important; }
html:root body .subject-card .subject-review-btn:hover { filter: saturate(1.08); }

/* "DERS GÜN | Gün" pill */
html:root body .subject-card .subject-controls {
  display: inline-flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 6px !important; width: auto !important; max-width: 100% !important;
  height: 42px !important; padding: 3px !important; margin: 0 !important; border-radius: 999px !important;
  border: 1px solid var(--ypc-line) !important; background: rgba(255, 255, 255, .8) !important; box-shadow: none !important;
}
html:root body .subject-card .subject-controls label {
  padding: 0 14px 0 16px !important; margin: 0 !important; font-family: var(--ypc-font) !important; white-space: nowrap !important; flex: 0 0 auto !important;
  font-size: 12.5px !important; font-weight: 700 !important; letter-spacing: .04em !important;
  text-transform: uppercase !important; color: #5d6380 !important;
}
html:root body .subject-card .subject-days-input {
  width: 150px !important; max-width: 46vw !important; height: 34px !important; padding: 0 14px !important; border-radius: 999px !important;
  border: 1px solid var(--ypc-lav-2) !important; background: var(--ypc-lav-bg) !important; box-shadow: none !important;
  font-family: var(--ypc-font) !important; font-size: 15px !important; font-weight: 800 !important;
  color: var(--ypc-violet) !important; text-align: center !important;
}
html:root body .subject-card .subject-days-input::placeholder { color: var(--ypc-violet) !important; opacity: .9 !important; font-weight: 800 !important; }
html:root body .subject-card .subject-days-input:focus,
html:root body .subject-card .subject-days-input:focus-visible {
  background: #fff !important; border-color: var(--ypc-lav) !important; outline: none !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .14) !important;
}
html:root body .subject-card .clear-override {
  height: 34px !important; padding: 0 14px !important; border-radius: 999px !important; margin-right: 2px !important;
  border: 1px solid var(--ypc-line) !important; background: #fff !important; color: var(--ypc-ink-2) !important;
  font-family: var(--ypc-font) !important; font-size: 12.5px !important; font-weight: 700 !important; box-shadow: none !important;
}
html:root body .subject-card .clear-override:hover { border-color: #fecaca !important; color: #dc2626 !important; }

/* ---------- Stat tiles with icons ---------- */
html:root body .subject-card .subject-stats {
  container-type: inline-size; container-name: ypc-stats;
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; margin: 0 0 16px !important;
}
html:root body .subject-card .subject-stats .stat {
  display: grid !important; grid-template-columns: 50px minmax(0, 1fr) !important; grid-template-rows: auto auto !important;
  align-items: center !important; column-gap: 14px !important; row-gap: 2px !important; min-width: 0 !important;
  padding: 14px 16px !important; margin: 0 !important; text-align: left !important;
  background: rgba(255, 255, 255, .92) !important; border: 1px solid #eeecf7 !important; border-radius: 20px !important;
  box-shadow: 0 10px 24px -16px rgba(49, 26, 120, .28), 0 1px 0 #fff inset !important; overflow: visible !important;
}
html:root body .subject-card .subject-stats .stat::before {
  content: '' !important; display: block !important; position: static !important; grid-column: 1; grid-row: 1 / 3;
  width: 50px !important; height: 50px !important; border-radius: 50% !important;
  background: var(--ypc-stat-bg) var(--ypc-stat-icon) center / 24px 24px no-repeat !important;
}
html:root body .subject-card .subject-stats .stat:nth-child(1) {
  --ypc-stat-bg: #fff0e6; --ypc-stat-ink: #ea580c;
  --ypc-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ea580c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/%3E%3C/svg%3E");
}
html:root body .subject-card .subject-stats .stat:nth-child(2) {
  --ypc-stat-bg: #e9f0ff; --ypc-stat-ink: #1d4ed8;
  --ypc-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M9 13h6M9 17h6M9 9h1'/%3E%3C/svg%3E");
}
html:root body .subject-card .subject-stats .stat:nth-child(3) {
  --ypc-stat-bg: #e6f7ee; --ypc-stat-ink: #047857;
  --ypc-stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01'/%3E%3C/svg%3E");
}
html:root body .subject-card .subject-stats .stat-value {
  grid-column: 2; grid-row: 1; align-self: end !important;
  background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ypc-stat-ink) !important;
  font-family: var(--ypc-font) !important; font-weight: 800 !important; font-size: 28px !important;
  letter-spacing: -.02em !important; line-height: 1 !important; font-variant-numeric: tabular-nums !important; margin: 0 !important;
}
html:root body .subject-card .subject-stats .stat-label {
  grid-column: 2; grid-row: 2; align-self: start !important; margin: 0 !important;
  font-family: var(--ypc-font) !important; font-size: 14px !important; font-weight: 600 !important;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--ypc-text) !important;
}
html:root body .subject-card .subject-stats .stat-value { font-size: min(28px, 6.2cqw) !important; }
/* Medium cards: smaller icon. */
@container ypc-stats (max-width: 470px) {
  html:root body .subject-card .subject-stats .stat { grid-template-columns: 40px minmax(0, 1fr) !important; column-gap: 10px !important; padding: 12px !important; border-radius: 18px !important; }
  html:root body .subject-card .subject-stats .stat::before { width: 40px !important; height: 40px !important; background-size: 20px 20px !important; }
  html:root body .subject-card .subject-stats .stat-label { font-size: 13px !important; }
}
/* Narrow cards (phones): icon above the number. */
@container ypc-stats (max-width: 380px) {
  html:root body .subject-card .subject-stats .stat {
    grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto auto auto !important;
    justify-items: center !important; text-align: center !important; padding: 12px 8px !important; row-gap: 4px !important;
  }
  html:root body .subject-card .subject-stats .stat::before { grid-column: 1; grid-row: 1; margin-bottom: 2px; }
  html:root body .subject-card .subject-stats .stat-value { grid-column: 1; grid-row: 2; font-size: 24px !important; }
  html:root body .subject-card .subject-stats .stat-label { grid-column: 1; grid-row: 3; }
}

/* ---------- Progress ---------- */
html:root body .subject-card .progress-bar-wrap {
  height: 12px !important; background: #ebe7fb !important; border-radius: 999px !important;
  box-shadow: inset 0 1px 2px rgba(49, 26, 120, .08) !important; margin: 0 0 10px !important;
}
html:root body .subject-card .progress-bar-fill {
  background: linear-gradient(90deg, #6d28d9 0%, #4f46e5 45%, #22d3ee 100%) !important;
  box-shadow: 0 2px 8px -2px rgba(79, 70, 229, .5) !important; animation: none !important; border-radius: 999px !important;
}
html:root body .subject-card .progress-bar-fill[style*='--success'] { background: linear-gradient(90deg, #059669, #10b981 60%, #34d399) !important; }
html:root body .subject-card .progress-label {
  font-family: var(--ypc-font) !important; font-size: 14px !important; font-weight: 700 !important;
  color: var(--ypc-ink-2) !important; letter-spacing: 0 !important; opacity: 1 !important; font-variant-numeric: tabular-nums !important;
  margin-bottom: 14px !important;
}

/* ---------- Topic list ---------- */
html:root body .subject-card .topic-list {
  container-type: inline-size; container-name: ypc-topics;
  gap: 8px !important; padding: 8px !important; margin-top: 0 !important;
  background: rgba(255, 255, 255, .65) !important; border: 1px solid var(--ypc-line) !important; border-radius: 22px !important;
  box-shadow: 0 1px 0 #fff inset !important; scrollbar-width: thin; scrollbar-color: #cdc6ea transparent;
}
html:root body .subject-card .topic-list::-webkit-scrollbar { width: 8px; }
html:root body .subject-card .topic-list::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
html:root body .subject-card .topic-list::-webkit-scrollbar-thumb { background: #cdc6ea; border: 2px solid #f8f7fd; border-radius: 999px; }

/* Rows. The check sits in the left gutter, centred on the whole row; the rest is a grid:
   open rows   [name ............ chips]
   done rows   [name ............ Tekrar yaptım]
               [age chip  ①–②–③ ..... Pay]                                                 */
html:root body .subject-card .topic-item {
  position: relative !important; display: grid !important;
  grid-template-columns: minmax(36%, 1fr) auto !important; grid-template-rows: auto !important; grid-template-areas: none !important;
  align-items: center !important; column-gap: 12px !important; row-gap: 10px !important;
  min-height: 64px !important; height: auto !important; margin: 0 !important; padding: 14px 14px 14px 64px !important;
  flex: 0 0 auto !important; /* rows never shrink inside the scrolling list (they used to overlap) */
  background: #fff !important; border: 1px solid #efedf7 !important; border-radius: 18px !important;
  box-shadow: 0 4px 14px -10px rgba(49, 26, 120, .25) !important; overflow: visible !important; transform: none !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
@media (hover: hover) {
  html:root body .subject-card .topic-item:hover {
    border-color: var(--ypc-lav-2) !important; transform: none !important;
    box-shadow: 0 8px 20px -12px rgba(109, 40, 217, .35) !important;
  }
}
html:root body .subject-card .topic-item .topic-main-toggle {
  position: static !important; grid-column: 1 !important; grid-row: 1 !important; grid-area: auto !important;
  display: flex !important; align-items: center !important; gap: 0 !important; min-height: 32px !important;
  width: 100% !important; min-width: 0 !important; max-width: 100% !important; align-self: center !important;
  padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important;
  text-align: left !important; color: inherit !important; cursor: pointer;
}
html:root body .subject-card .topic-item .topic-main-toggle:focus-visible { outline: 2px solid var(--ypc-violet-2) !important; outline-offset: 4px !important; border-radius: 8px !important; }
html:root body .subject-card .topic-item .completion-btn {
  position: absolute !important; left: 14px !important; top: calc(50% - 18px) !important; margin: 0 !important;
  width: 36px !important; height: 36px !important; min-width: 36px !important; flex: none !important;
  grid-area: auto !important; justify-self: auto !important; align-self: auto !important;
  border: 2.5px solid var(--ypc-lav) !important; border-radius: 50% !important; background: #fff !important; box-shadow: none !important;
}
html:root body .subject-card .topic-item .topic-main-toggle:hover .completion-btn:not(.completed) { border-color: #8b5cf6 !important; background: var(--ypc-lav-bg) !important; }
html:root body .subject-card .topic-item .topic-main-toggle:focus-visible .completion-btn { box-shadow: 0 0 0 4px rgba(124, 58, 237, .2) !important; }
html:root body .subject-card .topic-item .completion-btn.completed {
  width: 38px !important; height: 38px !important; top: 25px !important; left: 13px !important; /* centred on the name and its details */
  border: 0 !important; background: radial-gradient(circle at 35% 30%, #22c55e 0%, #16a34a 45%, #14532d 100%) !important;
  box-shadow: 0 0 0 4px #dcfce7, 0 6px 14px -4px rgba(21, 128, 61, .55) !important;
}
html:root body .subject-card .topic-item .completion-btn.completed::after {
  content: '' !important; position: absolute !important; left: 50% !important; top: 45% !important;
  width: 8px !important; height: 15px !important; border: solid #fff !important; border-width: 0 3px 3px 0 !important;
  border-radius: 1px !important; transform: translate(-50%, -50%) rotate(45deg) !important; font-size: 0 !important; color: transparent !important;
}
html:root body .subject-card .topic-item .topic-name {
  grid-area: auto !important; flex: 1 1 auto !important; min-width: 0 !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important;
  font-family: var(--ypc-font) !important; font-size: 16px !important; font-weight: 700 !important;
  line-height: 1.35 !important; letter-spacing: -.01em !important; color: var(--ypc-ink) !important; align-self: center !important;
  white-space: normal !important; overflow-wrap: break-word !important; word-break: normal !important; hyphens: manual !important;
}
html:root body .subject-card .topic-item .topic-stats {
  grid-column: 2 !important; grid-row: 1 !important; grid-area: auto !important;
  display: flex !important; flex-wrap: wrap !important; align-items: center !important; justify-content: flex-end !important;
  align-content: center !important; gap: 8px 10px !important; width: auto !important; min-width: 0 !important; max-width: 100% !important;
  padding: 0 !important; margin: 0 !important; height: auto !important; overflow: visible !important;
}

/* Chips */
html:root body .subject-card .topic-item .badge {
  grid-area: auto !important; display: inline-flex !important; align-items: center !important;
  height: 30px !important; padding: 0 12px !important; margin: 0 !important; border-radius: 999px !important;
  font-family: var(--ypc-font) !important; font-size: 13.5px !important; font-weight: 600 !important; line-height: 1 !important;
  letter-spacing: 0 !important; white-space: nowrap !important; font-variant-numeric: tabular-nums !important;
  box-shadow: none !important; text-transform: none !important; flex: 0 0 auto !important; justify-self: auto !important;
}
html:root body .subject-card .topic-item .badge-primary { background: #eef0f7 !important; color: var(--ypc-ink-2) !important; border: 1px solid #e6e8f2 !important; }
html:root body .subject-card .topic-item .badge-secondary { background: #e8f7ee !important; color: #047857 !important; border: 1px solid #cdeedb !important; }

/* Completed rows */
html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) {
  grid-template-columns: minmax(0, 1fr) auto !important; min-height: 0 !important;
  background: linear-gradient(90deg, #f3faf6 0%, #fbfcff 70%) !important; border-color: #e2f1e8 !important;
}
html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) .topic-name {
  color: #646b82 !important; font-weight: 600 !important; text-decoration: line-through !important;
  text-decoration-color: rgba(100, 107, 130, .55) !important; text-decoration-thickness: 1.5px !important;
}
html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-stats {
  grid-column: 1 / -1 !important; grid-row: 2 !important; justify-content: flex-start !important;
  display: flex !important; grid-template-columns: none !important; grid-template-areas: none !important; justify-items: normal !important; width: auto !important;
}
html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-review-action {
  grid-column: 2 !important; grid-row: 1 !important; grid-area: auto !important; justify-self: end !important; align-self: center !important; margin: 0 !important;
}
html:root body .subject-card .topic-item .topic-stats > * { grid-area: auto !important; justify-self: auto !important; }
html:root body .subject-card .topic-item .topic-stats > .topic-completion-age { order: 1 !important; }
html:root body .subject-card .topic-item .topic-stats > .stage-track { order: 2 !important; }
html:root body .subject-card .topic-item .topic-stats > .badge { order: 5 !important; }
html:root body .subject-card .topic-item .topic-stats > .badge-primary { margin-left: auto !important; }
html:root body .subject-card .topic-item .topic-stats > .topic-review-action { order: 9 !important; }
/* open rows keep their chips together on the right */
html:root body .subject-card .topic-item:not(.completed):not(:has(> .topic-main-toggle > .completion-btn.completed)) .topic-stats > .badge-primary { margin-left: 0 !important; }

/* Completion age: peach chip with a calendar, no parentheses. */
html:root body .subject-card .topic-item .topic-completion-age {
  display: inline-flex !important; align-items: center !important; gap: 7px !important; height: 30px !important;
  padding: 0 12px 0 10px !important; margin: 0 !important; border-radius: 10px !important;
  background: #fff3e2 !important; border: 1px solid #fde2bf !important; color: #9a3412 !important; box-shadow: none !important;
  font-family: 'ypc-hide-parens', var(--ypc-font) !important; font-size: 13px !important; font-weight: 600 !important; font-style: normal !important;
  letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap !important; min-width: 0 !important; width: auto !important;
}
html:root body .subject-card .topic-item .topic-completion-age::before {
  content: ''; width: 15px; height: 15px; flex: 0 0 15px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M8 15h3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M8 15h3'/%3E%3C/svg%3E") center / contain no-repeat;
}
html:root body .subject-card .topic-item .topic-completion-age.is-warning { background: #ffeedd !important; border-color: #fbd3a5 !important; color: #9a3412 !important; }
html:root body .subject-card .topic-item .topic-completion-age.is-danger { background: #ffe9e6 !important; border-color: #fecaca !important; color: #b91c1c !important; }

/* Review stages ①–②–③: outlined numbered circles. */
html:root body .subject-card .topic-item .stage-track {
  display: inline-flex !important; align-items: center !important; gap: 0 !important; counter-reset: ypc-stage;
  flex-wrap: nowrap !important; white-space: nowrap !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important;
  background: none !important; border: 0 !important; box-shadow: none !important;
}
html:root body .subject-card .topic-item .stage-pip {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  width: 26px !important; height: 26px !important; border-radius: 50% !important; font-size: 0 !important; line-height: 1 !important;
  color: #5a64c4 !important; background: #fff !important; border: 2px solid #c7d2fe !important;
  filter: none !important; box-shadow: none !important; flex: 0 0 26px !important;
}
html:root body .subject-card .topic-item .stage-pip::before {
  counter-increment: ypc-stage; content: counter(ypc-stage);
  font: 700 12.5px/1 var(--ypc-font); font-variant-numeric: tabular-nums;
}
html:root body .subject-card .topic-item .stage-pip.done { color: #0369a1 !important; border-color: #38bdf8 !important; }
html:root body .subject-card .topic-item .stage-pip.active { color: var(--ypc-violet) !important; border-color: var(--ypc-violet-2) !important; background: var(--ypc-lav-bg) !important; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12) !important; }
html:root body .subject-card .topic-item .stage-sep {
  display: inline-block !important; width: 10px !important; height: 2px !important; margin: 0 4px !important;
  font-size: 0 !important; background: #c7d2fe !important; border-radius: 2px !important; flex: 0 0 10px !important;
}
html:root body .subject-card .topic-item .stage-pip.done + .stage-sep { background: #7dd3fc !important; }
/* LGS: next-review label after the steps. */
html:root body .subject-card .topic-item .stage-next {
  display: inline-flex !important; align-items: center !important; height: 28px !important; padding: 0 12px !important;
  margin-left: 10px !important; border-radius: 999px !important; box-shadow: none !important;
  font-family: var(--ypc-font) !important; font-size: 12.5px !important; font-weight: 700 !important; letter-spacing: 0 !important;
  background: #eef0f7 !important; color: var(--ypc-ink-2) !important; border: 1px solid #e6e8f2 !important;
}
html:root body .subject-card .topic-item .stage-next-due { background: #fff1ee !important; color: #c81e1e !important; border-color: #ffd8cf !important; }
html:root body .subject-card .topic-item .stage-next-warn { background: #fff8e8 !important; color: #b45309 !important; border-color: #fde4a8 !important; }
html:root body .subject-card .topic-item .stage-next-ok { background: #edfbf4 !important; color: #047857 !important; border-color: #c4f0da !important; }

/* "Tekrar yaptım": gradient pill with a refresh icon. Due soon is a lighter blue, not due yet (LGS) is outlined. */
html:root body .subject-card .topic-item .topic-review-action {
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
  height: 40px !important; min-height: 40px !important; padding: 0 18px 0 14px !important; margin: 0 !important;
  border-radius: 999px !important; border: 0 !important; color: #fff !important;
  background: linear-gradient(120deg, #2563eb 0%, #4f46e5 55%, #6d28d9 100%) !important;
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .75), 0 1px 0 rgba(255, 255, 255, .25) inset !important;
  font-family: var(--ypc-font) !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1 !important;
  letter-spacing: 0 !important; white-space: nowrap !important; text-transform: none !important;
  visibility: visible !important; opacity: 1 !important; transform: none !important; cursor: pointer;
  transition: box-shadow .15s ease, filter .15s ease, background-color .15s ease !important;
}
html:root body .subject-card .topic-item .topic-review-action::before {
  content: ''; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16'/%3E%3Cpath d='M16 16h5v5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16'/%3E%3Cpath d='M16 16h5v5'/%3E%3C/svg%3E") center / contain no-repeat;
}
html:root body .subject-card .topic-item .topic-review-action:hover { filter: brightness(1.06); box-shadow: 0 12px 26px -10px rgba(79, 70, 229, .85) !important; }
html:root body .subject-card .topic-item .topic-review-action.is-warning { background: linear-gradient(120deg, #3b5bdb 0%, #5b5bd6 100%) !important; }
html:root body .subject-card .topic-item .topic-review-action.is-idle,
html:root body .subject-card .topic-item .topic-review-action.is-success {
  background: #fff !important; color: var(--ypc-violet) !important; box-shadow: inset 0 0 0 1.5px var(--ypc-lav-2) !important;
}
html:root body .subject-card .topic-item .topic-review-action.is-idle:hover,
html:root body .subject-card .topic-item .topic-review-action.is-success:hover { box-shadow: inset 0 0 0 1.5px var(--ypc-lav) !important; filter: none; }
html:root body .subject-card .topic-item .topic-review-action:focus-visible { outline: 3px solid rgba(124, 58, 237, .45) !important; outline-offset: 2px !important; }
html:root body .subject-card .topic-item .topic-review-action:active { transform: translateY(1px) !important; }

/* Medium lists: the YKS button moves under the details; the LGS button starts its own line. */
@container ypc-topics (max-width: 470px) {
  html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) { grid-template-columns: minmax(0, 1fr) !important; }
  html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-review-action {
    grid-column: 1 !important; grid-row: 3 !important; justify-self: end !important;
  }
  html:root body .subject-card .topic-item .topic-stats:has(> .topic-review-action)::after { content: ''; order: 8; flex: 0 0 100%; height: 0; }
  html:root body .subject-card .topic-item .topic-stats > .topic-review-action { margin-left: auto !important; }
}
/* Medium lists only: on done rows the Pay / Ağırlık chip sits beside the name, saving a line. */
@container ypc-topics (min-width: 361px) and (max-width: 470px) {
  html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-main-toggle { padding-right: 104px !important; }
  html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-stats { position: static !important; }
  html:root body .subject-card :is(.topic-item.completed, .topic-item:has(> .topic-main-toggle > .completion-btn.completed)) > .topic-stats > .badge-primary {
    position: absolute !important; top: 11px !important; right: 14px !important; margin: 0 !important; max-width: 96px !important;
  }
}
/* Narrow lists (phones): smaller check, chips under the name. */
@container ypc-topics (max-width: 360px) {
  html:root body .subject-card .topic-item { grid-template-columns: minmax(0, 1fr) !important; padding: 12px 12px 12px 58px !important; row-gap: 8px !important; }
  html:root body .subject-card .topic-item > .topic-stats { grid-column: 1 !important; grid-row: 2 !important; justify-content: flex-start !important; }
  html:root body .subject-card .topic-item .completion-btn { left: 12px !important; width: 34px !important; height: 34px !important; min-width: 34px !important; top: calc(50% - 17px) !important; }
  html:root body .subject-card .topic-item .completion-btn.completed { left: 12px !important; width: 34px !important; height: 34px !important; top: 22px !important; }
  html:root body .subject-card .topic-item .completion-btn.completed::after { width: 7px !important; height: 13px !important; border-width: 0 2.5px 2.5px 0 !important; }
  html:root body .subject-card .topic-item .topic-name { font-size: 15px !important; }
  html:root body .subject-card .topic-item .badge { height: 28px !important; padding: 0 11px !important; font-size: 13px !important; }
  html:root body .subject-card .topic-item .topic-stats > .badge-primary { margin-left: 0 !important; }
}

@media (pointer: coarse) {
  html:root body .subject-card .topic-item .topic-main-toggle { min-height: 40px !important; }
}
@media (max-width: 768px) {
  html:root body .subject-card { border-radius: 22px !important; }
  html:root body .subject-card .subject-title-text { font-size: 20px !important; }
  html:root body .subject-card .subject-title-text::first-letter { font-size: 22px; line-height: 44px; padding: 0 10px; border-radius: 14px; margin-right: 12px; }
  html:root body .subject-card .subject-controls { width: 100% !important; }
  /* width 0 + grow: the field fills the pill without widening the card on small phones */
  html:root body .subject-card .subject-days-input { flex: 1 1 0 !important; width: 0 !important; min-width: 0 !important; max-width: none !important; }
  html:root body .subject-card .topic-list { padding: 6px !important; border-radius: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html:root body .subject-card *, html:root body .subject-card { transition: none !important; }
}
