/* ============================================================
   قاوم — مخطط الأسبوع
   RTL · متجاوب من 320px · وضع نهاري وليلي · PWA
   ============================================================ */

:root {
  --bg: #f6f5f0;
  --bg-soft: #efeee7;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #faf9f5;
  --hover: #faf9f5;
  --ink: #121a1c;
  --ink-soft: #2b3739;
  --muted: #6d787a;
  --line: #e5e3da;
  --line-strong: #d5d2c6;
  --accent: #0e7a5f;
  --accent-ink: #0a5b46;
  --accent-soft: #e6f3ef;
  --on-accent: #ffffff;
  --amber: #b8721a;
  --amber-soft: #fbf0df;
  --blue: #2f5fb3;
  --blue-soft: #e8eefb;
  --danger: #b4453a;
  --danger-soft: #fbeceb;
  --invert-bg: #121a1c;
  --invert-ink: #ffffff;
  --topbar-bg: rgba(246, 245, 240, 0.94);
  --today-1: #f2faf7;
  --today-2: #ffffff;
  --tip-1: #fffdf7;
  --tip-2: #fbf6ea;
  --tip-line: #efe4cd;
  --tip-ink: #7a6337;
  --tip-title: #b8721a;
  --placeholder: #a3acae;
  --hero-1: #0b6b53;
  --hero-2: #0e7a5f;
  --hero-3: #14866a;
  --shadow-sm: 0 1px 2px rgba(18, 26, 28, 0.05);
  --shadow-md: 0 6px 18px rgba(18, 26, 28, 0.07);
  --shadow-lg: 0 18px 40px rgba(18, 26, 28, 0.12);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --font: "Cairo", "Noto Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d1214;
  --bg-soft: #151c1e;
  --surface: #121a1c;
  --surface-2: #182123;
  --surface-3: #1c2528;
  --hover: #1a2426;
  --ink: #e9efee;
  --ink-soft: #c9d4d2;
  --muted: #8c9b99;
  --line: #232e30;
  --line-strong: #33403f;
  --accent: #2fa886;
  --accent-ink: #7fe3c6;
  --accent-soft: rgba(47, 168, 134, 0.15);
  --on-accent: #06130f;
  --amber: #d99a4e;
  --amber-soft: rgba(217, 154, 78, 0.15);
  --blue: #7ea3e8;
  --blue-soft: rgba(126, 163, 232, 0.15);
  --danger: #e07d70;
  --danger-soft: rgba(224, 125, 112, 0.15);
  --invert-bg: #e9efee;
  --invert-ink: #0d1214;
  --topbar-bg: rgba(13, 18, 20, 0.92);
  --today-1: #122320;
  --today-2: #121a1c;
  --tip-1: #191a14;
  --tip-2: #1d1b13;
  --tip-line: #3a3524;
  --tip-ink: #d9c48c;
  --tip-title: #e0b56a;
  --placeholder: #5f6e6c;
  --hero-1: #08402f;
  --hero-2: #0a4d3a;
  --hero-3: #0d5c46;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: background 0.2s ease, color 0.2s ease;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  z-index: 60;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 0;
}

/* ------------------------------ أزرار ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 9px 15px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
  padding: 13px 20px;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(14, 122, 95, 0.22);
}

.btn-primary:hover {
  filter: brightness(0.94);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-danger {
  background: #b3372f;
  color: #fff;
}

.btn-danger:hover {
  background: #9c2d26;
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: default;
}

.delete-modal-text {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 14px;
}

.delete-modal-field {
  text-align: start;
  margin-bottom: 12px;
}

.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--ink-soft);
}

.btn-light {
  background: #ffffff;
  color: #0a5b46;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.btn-light:hover {
  background: #f2fbf8;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-soft);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

#themeBtn .icon-moon {
  display: none;
}

[data-theme="dark"] #themeBtn .icon-sun {
  display: none;
}

[data-theme="dark"] #themeBtn .icon-moon {
  display: block;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------- الشريط العلوي --------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(14, 122, 95, 0.28);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-text small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.topnav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-inline-start: 18px;
}

.topnav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.topnav a:hover {
  background: var(--bg-soft);
  color: var(--accent-ink);
}

.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-app {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu {
  position: relative;
  flex: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-chip:hover,
.user-chip[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--bg-soft);
}

.user-chip .chev {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
  transition: transform 0.15s ease;
}

.user-chip[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.user-pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  min-width: 232px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}

.user-pop[hidden] {
  display: none;
}

.user-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.avatar-lg {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.user-pop-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.user-pop-id strong {
  font-size: 14px;
  font-weight: 800;
}

.user-pop-id span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.user-pop-item {
  display: block;
  width: 100%;
  text-align: start;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--danger);
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.user-pop-item:hover {
  background: var(--danger-soft);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex: none;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout {
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 6px;
}

.logout:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
/* ------------------------------ الدخول ------------------------------ */

.auth {
  padding: 28px 0 48px;
  background:
    radial-gradient(1100px 520px at 100% -10%, rgba(14, 122, 95, 0.1), transparent 60%),
    radial-gradient(900px 480px at 0% 110%, rgba(184, 114, 26, 0.08), transparent 60%);
  min-height: calc(100vh - 64px);
}

.auth-grid {
  display: grid;
  gap: 26px;
  align-items: center;
  padding-top: 18px;
}

.auth-pitch .eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.auth-pitch h1 {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.auth-pitch p {
  margin-top: 12px;
  max-width: 46ch;
  font-size: 15.5px;
  color: var(--muted);
}

.auth-points {
  list-style: none;
  padding: 0;
  margin-top: 18px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-points li::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='%230e7a5f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  flex: none;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  margin-inline: auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: 999px;
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--placeholder);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 95, 0.12);
}

.field input[dir="ltr"] {
  text-align: left;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  /* الحقل ltr والزرار على الشمال في الصفحة العربية: خلي مكان للزرار ناحية الشمال */
  padding-left: 64px;
}

.reveal {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 8px;
}

.reveal:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.auth-error {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
}

.auth-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.auth-legal {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

/* ------------------------------- الهيرو ------------------------------- */

.hero {
  position: relative;
  background: linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 45%, var(--hero-3) 100%);
  color: #fff;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
  top: -180px;
  inset-inline-start: -80px;
}

.hero::after {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 214, 138, 0.16), transparent 65%);
  bottom: -200px;
  inset-inline-end: -60px;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding-top: 26px;
  padding-bottom: 28px;
}

.hero-copy,
.hero-panel {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(26px, 4.4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.hero-copy p {
  margin-top: 12px;
  max-width: 46ch;
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-points li::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 11px;
  background-repeat: no-repeat;
  background-position: center;
  flex: none;
}

.hero-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.ring-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  flex: none;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.2);
}

.ring-value {
  stroke: #ffffff;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.5s ease;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.ring-text strong {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ring-text span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-stats {
  display: grid;
  gap: 8px;
  flex: 1;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.stat strong {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.8);
}

/* ------------------------------ التخطيط ------------------------------ */

.layout {
  display: grid;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 40px;
}

.rail {
  display: grid;
  gap: 16px;
  order: 2;
}

.planner {
  order: 1;
  min-width: 0;
}

/* ------------------------------- الكروت ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-head h2 {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.card-head p {
  margin-top: 3px;
  font-size: 12.8px;
  color: var(--muted);
  line-height: 1.5;
}

.card-tip {
  background: linear-gradient(160deg, var(--tip-1), var(--tip-2));
  border-color: var(--tip-line);
}

.card-tip h2 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--tip-title);
}

.card-tip p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--tip-ink);
  line-height: 1.6;
}

/* -------------------------- اختيار اليوم -------------------------- */

.target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--line);
}

.target-row > label:first-child {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.select {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-weight: 700;
  min-width: 96px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  margin-inline-start: auto;
}

.switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ----------------------------- الاقتراحات ----------------------------- */

.suggestion-list {
  display: grid;
  gap: 10px;
}

.sug-group h3 {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease,
    color 0.14s ease;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip:active {
  transform: scale(0.97);
}

.chip-ico {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex: none;
}

.chip-ico svg {
  width: 14px;
  height: 14px;
}

.chip.is-study .chip-ico {
  color: var(--blue);
}

.chip.is-work .chip-ico {
  color: var(--amber);
}

.chip .plus {
  font-weight: 800;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
}

.chip.is-study .plus {
  color: var(--blue);
}

.chip.is-work .plus {
  color: var(--amber);
}

/* ------------------------------ القوالب ------------------------------ */

/* ---------------------------- شريط الأسبوع ---------------------------- */

.weekbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title nav"
    "progress progress";
  align-items: center;
  gap: 6px 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.weekbar-nav {
  grid-area: nav;
  display: flex;
  gap: 6px;
}

.weekbar-title {
  grid-area: title;
  min-width: 0;
}

.weekbar-title h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.weekbar-title span {
  font-size: 12px;
}

.weekbar-progress {
  grid-area: progress;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.weekbar-progress .bar {
  flex: 1;
  width: auto;
  height: 7px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}

.weekbar-progress .bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.35s ease;
}

/* ------------------------ تبويبات الأيام (موبايل) ------------------------ */

.day-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 62px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.25;
}

.day-tab small {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.day-tab .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.day-tab.has-tasks .dot {
  opacity: 1;
}

.day-tab.is-active {
  background: var(--invert-bg);
  border-color: var(--invert-bg);
  color: var(--invert-ink);
}

.day-tab.is-active small {
  color: var(--invert-ink);
  opacity: 0.7;
}

.day-tab.is-active .dot {
  background: var(--accent);
}

[data-theme="dark"] .day-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

[data-theme="dark"] .day-tab.is-active small {
  color: var(--on-accent);
  opacity: 0.78;
}

[data-theme="dark"] .day-tab.is-active .dot {
  background: var(--on-accent);
}

/* ---------------------------- شبكة الأسبوع ---------------------------- */

.week-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.day-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  scroll-margin-top: 130px;
}

.day-card.is-today {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--today-1) 0%, var(--today-2) 55%);
  box-shadow: 0 0 0 3px rgba(14, 122, 95, 0.09), var(--shadow-sm);
}

.day-card.is-today .day-head h3 {
  color: var(--accent-ink);
}

.day-card.is-selected {
  border-color: var(--accent);
}

.day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.day-head .d-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.day-head h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.day-head .d-date {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.today-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

.day-count {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.day-card.is-done .day-count {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.day-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-top: -4px;
}

.day-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.task {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 3px 4px;
  border-radius: 9px;
  transition: background 0.12s ease;
}

.task:hover {
  background: var(--hover);
}

.check {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
  border-radius: 7px;
  border: 1.6px solid var(--line-strong);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.check svg {
  width: 13px;
  height: 13px;
}

.check:hover {
  border-color: var(--accent);
}

.task.is-done .check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
}

.task-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
}

.task.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}

.task-time {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border-radius: 5px;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.tag {
  font-size: 10px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 999px;
  line-height: 1.7;
  white-space: nowrap;
}

.tag-habit {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tag-study {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-work {
  background: var(--amber-soft);
  color: var(--amber);
}

.del {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.del svg {
  width: 14px;
  height: 14px;
}

.task:hover .del,
.task:focus-within .del {
  opacity: 1;
}

.del:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-day {
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 8px;
  line-height: 1.5;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  margin: 4px 0 6px;
}

.add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: auto;
}

.add-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
}

.add-form input::placeholder {
  color: var(--placeholder);
  font-weight: 500;
}

.add-form input:focus {
  outline: none;
}

.add-form button {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.add-form button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.add-form button svg {
  width: 15px;
  height: 15px;
}

.day-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.copy-day {
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 6px;
}

.copy-day:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

@media (hover: none) {
  .del {
    opacity: 0.6;
  }
}

@media (hover: hover) and (min-width: 720px) {
  .day-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

/* --------------------------- كارت الملاحظات --------------------------- */

.notes-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-card textarea {
  flex: 1;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-3);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.6;
}

.notes-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 95, 0.1);
}

/* ------------------------------- التوست ------------------------------- */

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--invert-bg);
  color: var(--invert-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast button {
  border: 0;
  background: rgba(127, 127, 127, 0.22);
  color: inherit;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 700;
}

.toast button:hover {
  background: rgba(127, 127, 127, 0.34);
}

/* -------------------------------- الفوتر -------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 20px 0 28px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ============================================================
   موبايل
   ============================================================ */

@media (max-width: 899px) {
  .week-grid .day-card {
    display: none;
  }

  .week-grid .day-card.is-active {
    display: flex;
  }

  .week-grid .notes-card {
    display: flex;
    margin-top: 4px;
  }

  .weekbar-progress .bar {
    width: 56px;
  }
}

@media (max-width: 719px) {
  .hero-points {
    display: none;
  }

  .brand-text small {
    display: none;
  }

  .topbar-inner {
    gap: 8px;
  }

  .hero-copy p {
    font-size: 14.5px;
  }

  .hero-panel {
    padding: 14px;
    gap: 14px;
  }

  .ring-wrap {
    width: 96px;
    height: 96px;
  }

  .ring-text strong {
    font-size: 22px;
  }

  .stat {
    padding: 6px 9px;
  }

  .user-name {
    display: none;
  }

  .user-chip {
    padding: 4px;
  }

  .user-chip .chev {
    display: none;
  }

  .user-pop {
    min-width: 210px;
  }

  .topbar-app {
    gap: 6px;
  }

  .btn-label {
    display: none;
  }

  .topbar-actions .btn-sm,
  .topbar-actions .icon-btn {
    padding: 9px 10px;
  }

  #shareBtn {
    padding: 9px 11px;
  }

  .auth {
    padding-top: 14px;
  }

  .auth-pitch h1 {
    font-size: 30px;
  }
}

@media (max-width: 380px) {
  .brand-text {
    display: none;
  }

  .wrap {
    padding: 0 14px;
  }

  .topbar-app {
    gap: 4px;
  }
}

/* ============================================================
   ديسكتوب
   ============================================================ */

@media (min-width: 720px) {
  .wrap {
    padding: 0 26px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    align-items: center;
    gap: 32px;
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
  }

  .ring-wrap {
    margin: 0 auto;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 10px 6px;
    text-align: center;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-tabs {
    display: none;
  }

  .week-grid .day-card {
    display: flex;
  }

  .auth-grid {
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 48px;
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

@media (min-width: 900px) {
  .topnav {
    display: flex;
  }

  .layout {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding-top: 26px;
  }

  .rail {
    order: 0;
    position: sticky;
    top: 84px;
  }

  .planner {
    order: 0;
  }

  .weekbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "title progress nav";
    padding: 11px 16px;
  }

  .weekbar-progress .bar {
    flex: none;
    width: 90px;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .day-card {
    min-height: 190px;
  }
}

@media (min-width: 1100px) {
  .week-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1560px) {
  .week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============================================================
   v2 — اقتراحات ذكية، روتين، ترحيل، تركيز، مراجعة
   ============================================================ */

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover {
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.quick-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-top: -2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-strip::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quick-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.quick-chip .quick-ico {
  display: inline-flex;
  color: var(--accent);
}

.quick-chip .quick-ico svg {
  width: 14px;
  height: 14px;
}

.quick-chip.is-more {
  border-style: solid;
  color: var(--muted);
}

.day-notes {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.day-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.day-note.is-overload {
  background: var(--amber-soft);
  color: var(--amber);
}

.day-note.is-overlap {
  background: var(--blue-soft);
  color: var(--blue);
}

.day-note .note-ico {
  display: inline-flex;
  flex: none;
  margin-top: 1px;
}

.day-note .note-ico svg {
  width: 15px;
  height: 15px;
}

.rollover {
  margin: 8px 0 4px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-3);
}

.rollover-text {
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.rollover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rollover-actions .btn {
  padding: 8px 12px;
  font-size: 12.5px;
}

.sub-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
}

.task.is-open {
  flex-wrap: wrap;
  align-items: flex-start;
}

.subs {
  flex: 1 0 100%;
  margin: 6px 0 2px;
  padding: 8px 8px 6px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  display: grid;
  gap: 4px;
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sub-check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.6px solid var(--line-strong);
  background: var(--surface);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sub-check svg {
  width: 12px;
  height: 12px;
}

.sub-check.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.sub-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.sub-title.is-done {
  text-decoration: line-through;
  color: var(--muted);
}

.sub-del {
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  display: inline-flex;
}

.sub-del svg {
  width: 13px;
  height: 13px;
}

.sub-del:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.sub-form {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.sub-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--ink);
}

.sub-form button {
  flex: none;
  width: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sub-form button svg {
  width: 14px;
  height: 14px;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.task-act {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.task-act svg {
  width: 15px;
  height: 15px;
}

.task:hover .task-act,
.task:focus-within .task-act {
  opacity: 1;
}

.task-act:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.drag {
  flex: none;
  width: 16px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--line-strong);
  cursor: grab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.drag svg {
  width: 14px;
  height: 14px;
}

.task:hover .drag,
.task:focus-within .drag {
  opacity: 1;
}

.task.is-dragging {
  opacity: 0.35;
}

body.is-dragging,
body.is-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0.95;
  padding: 0;
}

.drop-line {
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  list-style: none;
  margin: 3px 0;
}

.day-card.is-drop {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

@media (hover: none) {
  .task-act,
  .drag {
    opacity: 1;
  }
}

.sug-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sug-hint {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: 999px;
}

.sug-group.is-smart .chip {
  border-color: var(--accent);
}

.sug-group.is-habits .sug-hint {
  background: var(--amber-soft);
  color: var(--amber);
}

.review-card {
  margin-top: 14px;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.review-body {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.rev-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.rev-pct {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--accent-ink);
}

.rev-delta {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.rev-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-3);
}

.rev-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

.rev-value {
  font-size: 15px;
  font-weight: 800;
}

.rev-sub {
  font-size: 12px;
  color: var(--muted);
}

.rev-sub-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 8px;
}

.rev-tags {
  display: grid;
  gap: 8px;
}

.rev-tag-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.rev-tag-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}

.rev-tag-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

.rev-tag.is-study .rev-tag-bar span {
  background: var(--blue);
}

.rev-tag.is-work .rev-tag-bar span {
  background: var(--amber);
}

.rev-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
}

.rev-day {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.rev-day-bar {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rev-day-bar span {
  display: block;
  width: 100%;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
  transition: height 0.3s ease;
}

.rev-day-bar span.is-zero {
  background: var(--line-strong);
}

.rev-day small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  text-align: center;
}

.empty-title {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 14px;
}

.empty-text {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.empty-day {
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.empty-day strong {
  font-size: 13px;
  color: var(--ink-soft);
}

body.is-focusing {
  overflow: hidden;
}

.focus {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 14, 16, 0.72);
  backdrop-filter: blur(6px);
}

.focus[hidden] {
  display: none;
}

.focus-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 26px 22px 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.focus-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.focus-title {
  margin: 0 0 18px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.35;
}

.focus-timer {
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
  line-height: 1;
}

.focus-timer.is-low {
  color: var(--danger);
}

.focus-modes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 18px;
}

.focus-mode {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.focus-mode.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.focus-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.focus-sound-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  flex-wrap: wrap;
}

.sound-status {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.focus-credit {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--muted);
  opacity: 0.75;
}

.focus-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.focus-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.focus-close:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

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

/* ============================================================
   v3 — تبسيط الواجهة: شريط الحالة + كارت الأدوات + التوقيع
   ============================================================ */

.strip {
  background: linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 45%, var(--hero-3) 100%);
  color: #fff;
}

.strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.strip-text {
  min-width: 0;
}

.strip-text h1 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}

.strip-text p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.strip-text p strong {
  color: #fff;
}

.strip-side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.ring-wrap.sm {
  width: 96px;
  height: 96px;
  position: relative;
  flex: none;
}

.ring-wrap.sm .ring-text strong {
  font-size: 24px;
}

.ring-wrap.sm .ring-text span {
  font-size: 12px;
}

@media (max-width: 719px) {
  .strip-inner {
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 10px;
  }

  .strip-text h1 {
    font-size: 18px;
  }

  .strip-text p {
    font-size: 12.5px;
  }

  .strip-text p #stripCheer {
    display: none;
  }

  .ring-wrap.sm {
    width: 78px;
    height: 78px;
  }

  .ring-wrap.sm .ring-text strong {
    font-size: 20px;
  }

  .strip-side {
    gap: 10px;
  }
}

/* ---- كارت الأدوات بتبويبات ---- */
.tools-panel[hidden] {
  display: none;
}

.tools-panel .target-row {
  margin-top: 0;
}

.tools-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- توقيع صانع التطبيق ---- */
.credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 2.4px;
  color: var(--muted);
  font-variant: small-caps;
}

.credit-mark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent, #0e7a5f);
  transform: rotate(45deg);
  flex: none;
  opacity: 0.85;
}

.footer-inner {
  flex-wrap: wrap;
  row-gap: 4px;
}

.credit-auth {
  margin: 14px 0 0;
  text-align: center;
}

/* ------ إصلاح شاشات اللابتوب: أزرار الإجراءات المخفية كانت تأكل من عرض عنوان المهمة ------ */
@media (hover: hover) and (pointer: fine) {
  .task {
    position: relative;
  }
  .task > .drag,
  .task > .task-act,
  .task > .del {
    position: absolute;
    top: 1px;
    opacity: 0;
    pointer-events: none;
    background: var(--surface);
    box-shadow: 0 0 6px 3px var(--surface);
    z-index: 2;
  }
  .task > .drag { inset-inline-end: 78px; cursor: grab; }
  .task > .del { inset-inline-end: 0; }
  .task > .task-act[data-action="focus"] { inset-inline-end: 26px; }
  .task > .task-act[data-action="subs"] { inset-inline-end: 52px; }
  .task:hover > .drag,
  .task:hover > .task-act,
  .task:hover > .del,
  .task:focus-within > .drag,
  .task:focus-within > .task-act,
  .task:focus-within > .del {
    opacity: 1;
    pointer-events: auto;
  }
}

/* عنوان المهمة ياخد العرض المتاح كله في السطر */
.task-title-row {
  flex: 1 1 auto;
}

.verify-card { display: grid; gap: 12px; text-align: center; margin-top: 40px; }
.verify-card .btn { width: 100%; }

/* ====================== سطر عن يومك ====================== */

.day-note {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.day-note::placeholder {
  color: var(--muted);
}

.day-note:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-style: solid;
}

/* ====================== شاشة الإحصائيات ====================== */

.stats-inner {
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 780px);
  overflow-y: auto;
  text-align: right;
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
}

.stats-inner .rev-days {
  margin-top: 4px;
}
