*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: var(--viewport-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: var(--viewport-h);
  height: var(--viewport-h);
  font-family: var(--font-main);
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overscroll-behavior-y: none;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
button {
  font-family: inherit;
  font-weight: 700;
}

button {
  color: inherit;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

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

img {
  max-width: 100%;
  display: block;
}

/* شريط تمرير مخصص */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 2px solid var(--scrollbar-track);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  height: var(--viewport-h);
  min-height: var(--viewport-h);
  max-height: var(--viewport-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.app-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.app-top-bar.hidden {
  display: none;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--green-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

[data-theme="dark"] .back-btn {
  color: var(--green-400);
}

[dir="rtl"] .back-btn .icon {
  transform: scaleX(-1);
}

.app-top-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.app-shell > main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
}

.page-header--sub {
  margin-bottom: var(--space-gap);
}

.home-fav-hint {
  margin-top: -4px;
  margin-bottom: 12px;
}

.home-all-dhikr {
  margin-top: 10px;
  width: 100%;
}

.view {
  display: none;
  padding: var(--space-inner) 14px;
  min-height: 100%;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: var(--space-section);
}

.page-header .page-sub {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.stack-section {
  margin-bottom: var(--space-section);
}

.stack-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.05rem;
  margin: 0 0 var(--space-gap);
  color: var(--text);
  font-weight: 800;
}

.muted-center {
  text-align: center;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.card-list .list-line {
  padding: 10px 0;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.row-label {
  font-size: 0.95rem;
  font-weight: 800;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-gap);
  align-items: center;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.view.active {
  display: block;
}

.page-title {
  font-size: 1.35rem;
  margin: 0 0 4px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-sub {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}
