/* ==========================================================================
   Coaching Sathi — stylesheet
   1. Design tokens        6. Dashboard
   2. Base & typography    7. Tables, forms & lists
   3. Buttons & controls   8. Feature pages
   4. App shell            9. Auth pages
   5. Page layout         10. Responsive
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  --primary: #0b7a63;
  --primary-dark: #075e4c;
  --primary-soft: #e7f6f1;
  --primary-ring: rgba(11, 122, 99, 0.22);
  --primary-grad: linear-gradient(135deg, #12a383 0%, #0a6b57 100%);

  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-alt: #f8fbfa;
  --text: #13201c;
  --text-2: #3b4944;
  --muted: #5d6c66;
  /* 4.9:1 on white */
  --border: #e2e9e6;
  --border-soft: #edf2f0;

  --green: #16865f;
  --green-soft: #e6f6ee;
  --red: #d14a42;
  --red-soft: #fdeeec;
  --blue: #2f6fd0;
  --blue-soft: #e8f0fd;
  --amber: #b9740b;
  --amber-soft: #fff3d9;

  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(16, 40, 33, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 40, 33, 0.05);
  --shadow-md: 0 6px 18px rgba(16, 40, 33, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 40, 33, 0.14);

  --sidebar-w: 264px;
  --header-h: 68px;
  --content-max: 1280px;
  --gutter: 24px;
}

/* 2. Base & typography --------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The hidden attribute must always win over component display rules. */
[hidden] {
  display: none !important;
}

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

/* clip (not hidden) so sticky sidebar/topbar keep working */
body {
  overflow-x: clip;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

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

img,
svg {
  display: block;
}

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

button,
a,
select,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 12px;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.danger-text {
  color: var(--red) !important;
}

/* 3. Buttons & controls -------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(11, 122, 99, 0.22);
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.button .icon {
  width: 16px;
  height: 16px;
}

.button [data-icon] {
  display: inline-flex;
}

.button-secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: transparent;
  box-shadow: none;
}

.button-secondary:hover {
  background: #d5efe6;
  border-color: transparent;
  color: var(--primary-dark);
  box-shadow: none;
}

.button-light {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--border);
}

.button-light:hover {
  background: var(--primary-soft);
  border-color: #cde6dd;
  color: var(--primary-dark);
  box-shadow: none;
}

.button-danger {
  background: #fff;
  color: var(--red);
  border-color: #f1cfcc;
  box-shadow: none;
}

.button-danger:hover {
  background: var(--red-soft);
  border-color: #e6aaa5;
  color: var(--red);
  box-shadow: none;
}

.full-button {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

.text-link,
.text-button {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
}

.text-link:hover {
  text-decoration: underline;
}

.text-button {
  border: 0;
  background: none;
  padding: 8px 0;
  cursor: pointer;
}

.text-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.back-link:hover {
  color: var(--primary);
}

.back-link .icon {
  width: 16px;
  height: 16px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #9aa5a0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

input:disabled {
  background: var(--surface-alt);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

/* 4. App shell ----------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 6px 14px rgba(11, 122, 99, 0.28);
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text b {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.brand-text small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 14px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 30;
}

/* Logo block is exactly as tall as the topbar, so both bottom borders line up. */
.sidebar>.brand {
  flex: none;
  height: var(--header-h);
  margin: 0 -14px 6px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar>.brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

/* The menu fits without scrolling; if a very short screen still needs it, the scrollbar stays hidden. */
.side-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

/* Roomy by default (tall screens); tightened for shorter screens in the max-height queries below.
   Sections use the same gap as the nav, so every link is evenly spaced whichever group it is in. */
.nav-section {
  display: grid;
  gap: 6px;
  padding: 0;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  margin: 0;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.side-nav a .icon {
  color: #84928c;
  transition: color 0.15s;
}

/* Clear hover / keyboard-focus state: tinted background, darker text, green icon, small nudge */
.side-nav a {
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  background: #f0f6f3;
  color: var(--primary-dark);
}

.side-nav a:hover .icon,
.side-nav a:focus-visible .icon {
  color: var(--primary);
}

.side-nav a.active:hover {
  background: var(--primary-soft);
}

.side-nav a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.side-nav a.active .icon {
  color: var(--primary);
}

.sidebar-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

.trial-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: #fffaf0;
  border: 1px solid #f3e3bd;
  color: #7a5310;
}

.trial-tile>.icon {
  width: 22px;
  height: 22px;
  color: var(--amber);
}

.trial-tile span {
  display: flex;
  flex-direction: column;
}

.trial-tile b {
  font-size: 13.5px;
}

.trial-tile small {
  font-size: 12px;
  color: #946b22;
}

.trial-tile:hover {
  border-color: #ecd291;
}

.side-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
}

.side-profile:hover {
  background: #eef6f2;
}

.side-profile>.icon {
  margin-left: auto;
  color: var(--muted);
  width: 16px;
  height: 16px;
}

.side-profile i,
.header-profile i {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
}

.side-profile>span,
.header-profile>span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.side-profile b,
.header-profile b {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-profile small,
.header-profile small {
  font-size: 12px;
  color: var(--muted);
}

/* Main column & topbar */
.main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.global-search,
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-alt);
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.global-search {
  width: min(520px, 100%);
}

.global-search:focus-within,
.search-field:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.global-search input,
.search-field input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: 100%;
  font-size: 14px;
}

.search-field [data-icon],
.global-search .icon {
  display: inline-flex;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.icon-button .icon {
  width: 20px;
  height: 20px;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
}

.menu-button {
  display: none;
}

/* Profile chip (top-right) + dropdown menu */
.profile-wrap {
  position: relative;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.header-profile:hover,
.header-profile[aria-expanded="true"] {
  border-color: #bfe0d4;
  box-shadow: 0 4px 14px rgba(11, 122, 99, 0.12);
}

.header-profile i {
  position: relative;
  width: 36px !important;
  height: 36px !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary-soft);
  margin: 2px;
}

.header-profile i::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.header-profile b {
  font-size: 14px;
  color: var(--text);
}

.profile-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.15s;
}

.header-profile[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 270px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: notif-in 0.16s ease-out;
}

.profile-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

.profile-menu-head>div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-menu-head b {
  font-family: var(--font-head);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-head small {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-avatar {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-style: normal;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary-soft);
}

.profile-menu a,
.profile-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}

.profile-menu a .icon,
.profile-menu button .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.profile-menu a:hover,
.profile-menu a:focus-visible {
  background: var(--surface-alt);
  color: var(--primary-dark);
}

.profile-menu a:hover .icon {
  color: var(--primary);
}

.profile-menu button[data-feedback]:hover,
.profile-menu button[data-feedback]:focus-visible {
  background: var(--surface-alt);
  color: var(--primary-dark);
}

.profile-menu button[data-feedback]:hover .icon {
  color: var(--primary);
}

.profile-menu a span,
.profile-menu button span {
  flex: 1;
}

.pm-plan {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
}

.pm-plan.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.pm-plan.is-expired {
  background: var(--red-soft);
  color: var(--red);
}

.profile-menu .pm-logout {
  margin-top: 6px;
  border-top: 1px solid var(--border-soft);
  border-radius: 0 0 10px 10px;
  padding-top: 12px;
  color: var(--red);
}

.profile-menu .pm-logout .icon {
  color: var(--red);
}

.profile-menu .pm-logout:hover {
  background: var(--red-soft);
  border-radius: 10px;
}

.drawer-scrim {
  display: none;
}

/* In-app footer (one quiet line) */
.app-footer {
  margin-top: auto;
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 16px var(--gutter) 22px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.app-footer a:hover {
  color: var(--primary);
}

/* Bottom navigation (phones and small tablets; see responsive section) */
.bottom-nav {
  display: none;
}

/* Toast */
.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 380px;
  padding: 13px 18px;
  border-radius: var(--r-md);
  background: #12332a;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast-region.show {
  opacity: 1;
  transform: none;
}

/* 5. Page layout --------------------------------------------------------- */
.content {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
}

.page-title-row,
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-title-row h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-title-row p:not(.eyebrow),
.section-title-row p {
  color: var(--muted);
  font-size: 14.5px;
}

.section-title-row {
  margin-bottom: 14px;
}

.section-title-row h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading>div {
  min-width: 0;
  flex: 1 1 0;
}

.panel-heading h2 {
  font-size: 16px;
  font-weight: 700;
}

.panel-heading p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.heading-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.heading-icon .icon {
  width: 20px;
  height: 20px;
}

.green-icon {
  background: var(--green-soft);
  color: var(--green);
}

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

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

.subtle-link {
  flex: none;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.subtle-link:hover {
  background: #d5efe6;
}

.count-pill {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
}

.section-space {
  margin-top: 22px;
}

.empty-note {
  padding: 18px 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-state b {
  font-family: var(--font-head);
  font-size: 17px;
}

.empty-state>span:not(.empty-icon) {
  color: var(--muted);
  font-size: 14px;
  max-width: 420px;
}

.empty-state .button {
  margin-top: 10px;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}

a.stat-card:hover {
  border-color: #bcdccf;
}

.stat-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon .icon {
  width: 21px;
  height: 21px;
}

.stat-card>div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.stat-card small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.stat-card b {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0;
}

.stat-card.red b {
  color: var(--red);
}

.stat-card>div>span {
  font-size: 12.5px;
  color: var(--muted);
}

/* Avatars & status */
.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
}

.status,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--red-soft);
  color: var(--red);
}

.status::before,
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.paid,
.status-badge.paid {
  background: var(--green-soft);
  color: var(--green);
}

.status.partial,
.status-badge.partial {
  background: var(--amber-soft);
  color: var(--amber);
}

/* 6. Dashboard ----------------------------------------------------------- */
.dash-head {
  align-items: flex-end;
}

.dash-head h1 {
  margin-bottom: 2px;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-grid .stat-card {
  color: inherit;
}

.kpi-grid .stat-card>div {
  flex: 1;
}

.kpi-progress {
  margin: 8px 0 0;
  height: 6px;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.dash-main,
.dash-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* Single-column grids use minmax(0, 1fr) so long text can never push rows wider than their panel. */
.task-list,
#today-classes,
#recent-students,
.record-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.task-list {
  gap: 8px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

a.task-row:hover {
  border-color: #bcdccf;
  background: var(--surface-alt);
}

.task-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.task-icon .icon {
  width: 18px;
  height: 18px;
}

.task-icon.red-task {
  background: var(--red-soft);
  color: var(--red);
}

.task-row-main {
  flex: 1;
  min-width: 0;
}

.task-row-main b,
.task-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-main b {
  font-size: 14px;
  font-weight: 600;
}

.task-row-main span {
  font-size: 12.5px;
  color: var(--muted);
}

.task-row>.button {
  flex: none;
}

/* Progress bar (dashboard KPI, subscription status) */
.progress {
  grid-column: 1 / -1;
  height: 8px;
  margin: 16px 0 8px;
  border-radius: 999px;
  background: #e3ebe8;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.4s ease;
}

/* Compact list rows (pending fees, recently added) */
.list-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  color: inherit;
}

.list-row:last-child {
  border-bottom: 0;
}

a.list-row:hover .list-person b {
  color: var(--primary);
}

.list-person {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
}

.list-person>span:last-child {
  min-width: 0;
}

.list-person b,
.list-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-person b {
  font-size: 14px;
  font-weight: 600;
}

.list-person small {
  font-size: 12.5px;
  color: var(--muted);
}

.list-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.list-more {
  display: block;
  padding: 10px 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.list-more:hover {
  text-decoration: underline;
}

.row-chevron {
  width: 16px;
  height: 16px;
  color: #a3b0ab;
}

.wa-button {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.muted-count {
  font-weight: 500;
  color: var(--muted);
  font-size: 15px;
}

.empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-alt);
}

.empty-inline>.icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.empty-inline span {
  display: flex;
  flex-direction: column;
}

.empty-inline b {
  font-size: 14px;
}

.empty-inline small {
  font-size: 13px;
  color: var(--muted);
}

.empty-inline a {
  color: var(--primary);
  font-weight: 600;
}

/* Today panel */
.att-split {
  display: flex;
  height: 10px;
  border-radius: 999px;
  background: #e7ecea;
  overflow: hidden;
}

.att-split span {
  height: 100%;
}

.att-split .is-present {
  background: var(--green);
}

.att-split .is-absent {
  background: var(--red);
}

.att-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.att-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9d3cf;
  display: inline-block;
}

.dot.is-present {
  background: var(--green);
}

.dot.is-absent {
  background: var(--red);
}

.side-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-subhead .subtle-link {
  text-transform: none;
  letter-spacing: 0;
  padding: 4px 10px;
  font-size: 12.5px;
}

#today-classes {
  gap: 0;
}

.mini-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row b {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mini-row small {
  font-size: 12.5px;
  color: var(--muted);
}

.schedule-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.schedule-row time {
  flex: none;
  width: 52px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.schedule-row span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Panels adapt to their OWN width (not the screen). */
.panel {
  container-type: inline-size;
}

@container (max-width: 520px) {

  /* Narrow panels: the whole row is the link, so the button can go and the text can wrap */
  a.task-row>.button {
    display: none;
  }

  a.task-row::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid #a3b0ab;
    border-top: 2px solid #a3b0ab;
    transform: rotate(45deg);
    margin-right: 4px;
  }

  .task-row-main b,
  .task-row-main span {
    white-space: normal;
  }

  .list-amount .status-badge {
    display: none;
  }
}

/* 7. Tables, forms & lists ---------------------------------------------- */
.directory-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.search-field {
  flex: 1 1 260px;
  max-width: 460px;
  background: #fff;
}

.filter-label select {
  min-width: 170px;
}

.date-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.date-field input {
  width: auto;
  background: #fff;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover {
  background: #fafcfb;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-person b {
  display: block;
  font-size: 14px;
}

.table-person b:hover {
  color: var(--primary);
}

.table-person small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions .button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

/* Tables become stacked cards whenever their panel is narrow —
   works on phones, tablets and small laptops alike (container query). */
.directory-panel {
  container-type: inline-size;
}

@container (max-width: 720px) {
  .table-scroll {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .table-scroll table,
  .table-scroll tbody,
  .table-scroll tr,
  .table-scroll td {
    display: block;
    width: 100%;
  }

  .table-scroll table {
    white-space: normal;
  }

  .table-scroll thead {
    display: none;
  }

  .table-scroll tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 12px;
  }

  .table-scroll tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: #fff;
  }

  .table-scroll tbody tr:hover {
    background: #fff;
    border-color: #cfe5dd;
  }

  .table-scroll td {
    padding: 0;
    border: 0 !important;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .table-scroll td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .table-scroll td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft) !important;
  }

  .table-scroll .hide-compact,
  .wide-only {
    display: none;
  }

  .compact-only {
    display: block !important;
  }

  /* Students / fees: a calm one-line list instead of label-heavy cards */
  .compact-list tbody {
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
  }

  .compact-list tr {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
  }

  .compact-list tr:last-child {
    border-bottom: 0;
  }

  .compact-list tr[data-href] {
    cursor: pointer;
  }

  .compact-list tr[data-href]:active {
    background: var(--surface-alt);
  }

  .compact-list td:first-child {
    grid-column: auto;
    padding-bottom: 0;
    border-bottom: 0 !important;
  }

  .compact-list td[data-label]::before {
    display: none;
  }

  .compact-list td.cell-status,
  .compact-list td.cell-amount {
    justify-self: end;
  }

  .fee-list tr {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .fee-list td:first-child {
    grid-row: span 2;
  }

  .fee-list td.cell-amount {
    font-size: 15px;
    font-weight: 700;
  }

  .fee-list td.cell-actions {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .fee-list .table-actions .button {
    flex: 1;
  }

  .table-scroll td.cell-actions {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .table-actions .button {
    flex: 1 1 auto;
    min-height: 38px;
  }
}

.form-panel {
  padding: 22px;
}

.form-section h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.form-section h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.form-section>p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.form-section em {
  font-style: normal;
  color: var(--red);
}

/* 3 fields per row; drops to 2 and then 1 as the form panel gets narrower (container queries below). */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

@container (max-width: 760px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .full-field {
    grid-column: auto;
  }
}

/* Block labels keep "Name *" / "Homework (optional)" on one line; the control sits below. */
.form-grid label,
.payment-dialog label,
.report-controls label {
  display: block;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.form-grid label> :is(input, select, textarea),
.payment-dialog label>input,
.report-controls label>select {
  display: block;
  margin-top: 7px;
}

.form-grid label>span {
  color: var(--muted);
  font-weight: 400;
}

.form-grid small {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.full-field {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.upload-label {
  cursor: pointer;
}

.record-list {
  gap: 10px;
}

.record-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.record-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.record-card h3 {
  font-size: 15px;
}

.record-card p {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 6px;
}

.record-card p b {
  color: var(--text);
}

.record-card time {
  flex: none;
  font-size: 12.5px;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
}

/* 8. Feature pages ------------------------------------------------------- */
/* Attendance */
.attendance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border-soft);
}

.attendance-row:last-child {
  border-bottom: 0;
}

.attendance-row-main {
  flex: 1;
  min-width: 0;
}

.attendance-row-main b,
.attendance-row-main small {
  display: block;
}

.attendance-row-main b {
  font-size: 14px;
}

.attendance-row-main small {
  font-size: 12.5px;
  color: var(--muted);
}

.attendance-options {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #eef3f1;
}

.attendance-options button {
  min-width: 82px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.attendance-options button:hover {
  color: var(--text);
}

.attendance-options button.present-selected {
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

.attendance-options button.absent-selected {
  background: var(--red);
  color: #fff;
  box-shadow: none;
}

/* Student details */
.student-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.student-heading .avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
  background: var(--primary-grad);
  color: #fff;
}

.student-heading h1 {
  font-size: 26px;
  font-weight: 800;
}

.student-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.profile-stat b {
  display: block;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
}

.profile-stat span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.detail-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.detail-sections h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.detail-line:last-child {
  border-bottom: 0;
}

.detail-line span {
  color: var(--muted);
  flex: none;
  white-space: nowrap;
}

.detail-line b {
  text-align: right;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Reports */
.report-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: #e9efed;
}

.report-tabs button {
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.report-tabs button.selected {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.report-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.report-controls label {
  min-width: 260px;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.report-card h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 6px;
}

.report-card strong {
  display: block;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
}

.report-card p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* Subscription */
/* Current status card */
.sub-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-left: 5px solid var(--amber);
}

.sub-status.is-active {
  border-left-color: var(--green);
}

.sub-status.is-expired {
  border-left-color: var(--red);
  background: linear-gradient(100deg, #fff5f4, #fff);
}

.sub-status-icon {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--amber-soft);
  color: var(--amber);
}

.sub-status.is-active .sub-status-icon {
  background: var(--green-soft);
  color: var(--green);
}

.sub-status.is-expired .sub-status-icon {
  background: var(--red-soft);
  color: var(--red);
}

.sub-status-icon .icon {
  width: 26px;
  height: 26px;
}

.sub-status-main {
  flex: 1;
  min-width: 0;
}

.sub-status-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sub-status-title h2 {
  font-size: 20px;
}

.sub-status-main>p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14.5px;
}

.sub-status-main>p b {
  color: var(--text);
}

.sub-status .progress {
  margin: 12px 0 0;
  height: 8px;
}

.sub-status.is-none {
  border-left-color: var(--red);
  background: linear-gradient(100deg, #fff5f4, #fff);
}

.sub-status.is-none .sub-status-icon {
  background: var(--red-soft);
  color: var(--red);
}

.sub-status.is-expired .progress span {
  background: var(--red);
}


/* Plan picker */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.plan-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.plan-option:hover .plan-card {
  border-color: #b9dccf;
  transform: translateY(-2px);
}

.plan-option input:checked+.plan-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-md);
}

.plan-option input:focus-visible+.plan-card {
  outline: 3px solid var(--primary-ring);
  outline-offset: 3px;
}

.plan-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-name {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
}

.plan-check {
  flex: none;
  color: var(--border);
  transition: color 0.15s;
}

.plan-check .icon {
  width: 24px;
  height: 24px;
}

.plan-option input:checked+.plan-card .plan-check {
  color: var(--primary);
}

.plan-amount {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-amount strong {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.plan-amount span {
  color: var(--muted);
  font-size: 14px;
}

.plan-billed {
  font-size: 13.5px;
  color: var(--muted);
}

.plan-billed s {
  color: #a3aea9;
  margin-right: 4px;
}

.plan-badge {
  position: absolute;
  top: -13px;
  right: 20px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(232, 147, 12, 0.3);
}

/* Checkout */
/* Features on the left, payment (order summary) on the right. On mobile the payment comes first again. */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
  gap: 16px;
  align-items: start;
}

/* feature columns ~58% · order summary ~42% (never narrower than 340px) */
.checkout-grid .checkout-panel {
  order: 2;
}

.summary-lines {
  margin-bottom: 18px;
}

.summary-total {
  margin-top: 4px;
  padding-top: 14px !important;
  border-top: 2px dashed var(--border);
  border-bottom: 0 !important;
  font-size: 16px !important;
}

.summary-total b {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
}

.pay-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.pay-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--amber);
}

.features-panel h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
}

.feature-list li::before {
  content: "✓";
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px !important;
  color: var(--text-2);
}

/* Expiry / renew banner (all pages) */
.renew-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid #f3dfae;
  border-radius: var(--r-md);
  background: #fff8e6;
  color: #6d4a0c;
}

.renew-banner>.icon {
  width: 22px;
  height: 22px;
  color: var(--amber);
}

.renew-banner p {
  flex: 1 1 240px;
  font-size: 14px;
}

.renew-banner.is-expired {
  border-color: #f1c8c4;
  background: var(--red-soft);
  color: #8e2a24;
}

.renew-banner.is-expired>.icon {
  color: var(--red);
}

.trial-tile.is-expired {
  background: var(--red-soft);
  border-color: #f1c8c4;
  color: #8e2a24;
}

.trial-tile.is-expired>.icon,
.trial-tile.is-expired small {
  color: var(--red);
}

/* Fee payments are recorded, never collected online */
.payment-note {
  font-size: 12.5px;
  color: var(--muted, #6b7a76);
  margin: 4px 0 12px;
  line-height: 1.45;
}

.payment-history .detail-line span small {
  display: block;
  font-size: 12px;
  color: var(--muted, #6b7a76);
  margin-top: 2px;
}

.payment-history .detail-line b {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Plan feature markers */
.pro-tile .pro-avail {
  font-style: normal;
  color: #b4690e;
  font-weight: 600;
}

.pro-tile b .tier-chip {
  font-size: 10px;
  padding: 1px 6px;
  vertical-align: 2px;
}

.pro-sup {
  font-size: 9px;
  font-weight: 700;
  color: #b4690e;
  margin-left: 3px;
  vertical-align: super;
  letter-spacing: .03em;
}

.features-soon {
  font-size: 12.5px;
  color: var(--muted, #6b7a76);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* "Choose a plan" dialog (view-only mode) */
.plan-gate {
  max-width: 460px;
}

.plan-gate-list {
  list-style: none;
  margin: 4px 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.plan-gate-list li {
  padding: 10px 12px;
  border: 1px solid var(--line, #e3e8e6);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.plan-gate-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-gate-actions .button {
  flex: 1 1 160px;
  justify-content: center;
}

/* Test-mode checkout dialog */
.pay-dialog {
  width: min(440px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pay-dialog::backdrop {
  background: rgba(14, 30, 25, 0.5);
  backdrop-filter: blur(2px);
}

.pay-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--primary-grad);
  color: #fff;
}

.pay-logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.pay-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pay-head-text small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
}

.pay-head strong {
  font-family: var(--font-head);
  font-size: 22px;
}

.pay-head .dialog-close {
  margin: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.test-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 20px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f3dfae;
  color: #6d4a0c;
  font-size: 12.5px;
}

.test-badge .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--amber);
}

.test-badge code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
}

#pay-form {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pay-methods label {
  cursor: pointer;
}

.pay-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-methods span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.pay-methods input:checked+span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pay-methods input:focus-visible+span {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.pay-fields {
  display: grid;
  gap: 12px;
}

.pay-fields label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.pay-fields label> :is(input, select) {
  display: block;
  margin-top: 6px;
}

.pay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pay-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.pay-secure .icon {
  width: 14px;
  height: 14px;
}

.pay-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px 44px;
  text-align: center;
}

.pay-processing small {
  color: var(--muted);
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin-bottom: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success dialog */
.success-body {
  display: grid;
  gap: 12px;
  text-align: center;
  justify-items: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.success-icon .icon {
  width: 40px;
  height: 40px;
}

.success-body h2 {
  font-size: 22px;
}

.success-body>p {
  color: var(--muted);
  font-size: 15px;
}

.success-meta {
  width: 100%;
  padding: 4px 14px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
}

.success-meta b {
  overflow-wrap: anywhere;
}

/* Help */
.help-search {
  max-width: 100%;
  margin-bottom: 4px;
  background: #fff;
  height: 48px;
}

.faq-panel {
  margin-top: 16px;
  padding: 20px;
}

.faq-panel>h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.faq-group {
  margin-top: 20px;
}

.faq-group h3 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.faq-group details {
  border-bottom: 1px solid var(--border-soft);
}

.faq-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-group summary::-webkit-details-marker {
  display: none;
}

.faq-group summary::after {
  content: "+";
  flex: none;
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s;
}

.faq-group details[open] summary::after {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-group summary:hover {
  color: var(--primary-dark);
}

.faq-group details p {
  padding: 0 2px 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.contact-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 18px 20px;
}

.contact-panel>div {
  flex: 1;
  min-width: 200px;
}

.contact-panel h2 {
  font-size: 17px;
  margin-bottom: 2px;
}

.contact-panel p {
  font-size: 14px;
  color: var(--muted);
}

/* Payment dialog */
.payment-dialog {
  width: min(440px, calc(100% - 24px));
  padding: 26px;
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.payment-dialog::backdrop {
  background: rgba(14, 30, 25, 0.45);
  backdrop-filter: blur(2px);
}

.payment-dialog form {
  display: grid;
  gap: 14px;
}

.payment-dialog h2 {
  font-size: 22px;
}

.payment-dialog p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
}

.payment-dialog .eyebrow {
  margin-bottom: -8px;
}

.payment-dialog .form-actions {
  margin-top: 6px;
}

.payment-dialog .form-actions .button {
  flex: 1;
}

.dialog-close {
  justify-self: end;
  width: 34px;
  height: 34px;
  margin-bottom: -40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-alt);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* Account (sidebar + settings) */
.side-account {
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-account .side-profile {
  flex: 1;
  min-width: 0;
}

.logout-button {
  width: 38px;
  height: 38px;
  color: var(--muted);
}

.logout-button:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f1cfcc;
}

.logout-button .icon {
  width: 18px;
  height: 18px;
}

.account-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.account-panel>div {
  flex: 1;
  min-width: 200px;
}

.account-panel h2 {
  font-size: 17px;
  margin-bottom: 2px;
}

.account-panel p {
  font-size: 14px;
  color: var(--muted);
}

.account-panel p b {
  color: var(--text);
}

/* 9. Login / sign up ----------------------------------------------------- */
.auth-page {
  background: var(--surface);
}

.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* Brand panel */
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 56px;
  background: var(--primary-grad);
  color: #fff;
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.07);
}

.auth-hero::before {
  width: 460px;
  height: 460px;
  right: -160px;
  top: -140px;
}

.auth-hero::after {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: -120px;
}

.auth-hero>* {
  position: relative;
  z-index: 1;
}

.brand-light .brand-mark {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-light .brand-text b {
  color: #fff;
}

.brand-light .brand-text small {
  color: rgba(255, 255, 255, 0.75);
}

.auth-hero-body {
  max-width: 520px;
}

.hero-chip {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 600;
}

.auth-hero h1 {
  color: #fff;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.auth-hero h1 span {
  color: #b8f0dc;
}

.auth-hero-body>p {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.hero-features {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.hero-features i {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
}

.hero-features div {
  display: flex;
  flex-direction: column;
}

.hero-features b {
  font-size: 14px;
}

.hero-features span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-foot {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* Form panel */
.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--surface);
}

.auth-box {
  width: min(100%, 420px);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: #eef3f1;
}

.auth-tabs[hidden] {
  display: none;
}

.auth-tabs button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form header {
  margin-bottom: 6px;
}

.auth-form h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-form header p {
  color: var(--muted);
  font-size: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-group {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.input-group .prefix {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 48px;
  height: 100%;
  padding: 0 12px;
  border-right: 1px solid var(--border-soft);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.input-group input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 14px !important;
  font-size: 15px;
  background: transparent;
}

.input-group input[type="password"] {
  letter-spacing: 0.3em;
}

.input-group input[type="password"]::placeholder {
  letter-spacing: normal;
}

.pin-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pin-toggle:hover {
  color: var(--primary);
}

.form-row-end {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.link-reset {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: 4px;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* spam honeypot: hidden from people */
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--primary);
}

.form-error,
.form-success {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

.form-error {
  background: var(--red-soft);
  color: #a8332c;
  border: 1px solid #f3cfcb;
}

.form-success {
  background: var(--green-soft);
  color: #0f6a4b;
  border: 1px solid #c7ebd9;
}

.form-error[hidden],
.form-success[hidden] {
  display: none;
}

.switch-text {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-note .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Sidebar polish (light theme): icon tiles, clear hover, strong active state */
.sidebar {
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(16, 40, 33, 0.04);
}

.sidebar .side-nav a {
  height: 44px;
  padding: 0 8px;
  border-radius: 12px;
}

.sidebar .side-nav a .icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 9px;
  background: #f1f6f4;
  color: #6f7f78;
  transition: background 0.15s, color 0.15s;
}

.sidebar .side-nav a:hover .icon,
.sidebar .side-nav a:focus-visible .icon {
  background: #dcf1e8;
  color: var(--primary);
}

.sidebar .side-nav a.active,
.sidebar .side-nav a.active:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar .side-nav a.active .icon {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(11, 122, 99, 0.3);
}

.sidebar .trial-tile>.icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.sidebar .sidebar-bottom {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-height: 860px) {
  .sidebar .side-nav a {
    height: 40px;
  }

  .sidebar .side-nav a .icon {
    width: 28px;
    height: 28px;
    padding: 6px;
  }
}

@media (max-height: 720px) {
  .sidebar .side-nav a {
    height: 34px;
  }

  .sidebar .side-nav a .icon {
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 7px;
  }

  .sidebar .trial-tile>.icon {
    width: 26px;
    height: 26px;
    padding: 5px;
  }
}

/* Notifications dropdown */
.notif-wrap {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.notification-button[aria-expanded="true"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #cfe5dd;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 370px;
  max-height: min(520px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: notif-in 0.16s ease-out;
}

.notif-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 15px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

@keyframes notif-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.notif-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.notif-head b {
  display: block;
  font-family: var(--font-head);
  font-size: 16px;
}

.notif-head small {
  font-size: 12.5px;
  color: var(--muted);
}

.notif-head .link-button {
  font-size: 13px;
}

.notif-list {
  overflow-y: auto;
  padding: 6px;
}

.notif-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.12s;
}

.notif-item:hover,
.notif-item:focus-visible {
  background: var(--surface-alt);
}

.notif-item.is-new {
  background: #f4faf7;
}

.notif-item.is-new:hover {
  background: #eaf6f0;
}

.notif-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.notif-icon .icon {
  width: 18px;
  height: 18px;
}

.tone-green {
  background: var(--green-soft);
  color: var(--green);
}

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

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

.tone-red {
  background: var(--red-soft);
  color: var(--red);
}

.notif-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-text b {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.notif-item:not(.is-new) .notif-text b {
  font-weight: 500;
  color: var(--text-2);
}

.notif-text small {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.notif-dot {
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.notif-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 32px 20px 36px;
  text-align: center;
}

.notif-empty .icon {
  width: 36px;
  height: 36px;
  color: var(--green);
  margin-bottom: 6px;
}

.notif-empty small {
  color: var(--muted);
}

@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - var(--header-h) - 20px);
  }

  .notif-panel::before {
    display: none;
  }

  .profile-menu {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: 10px;
  }
}

/* Wordmark logo image (assets/logo-wordmark.png) */
.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
}

.sidebar>.brand .brand-logo {
  height: 30px;
}

.footer-brand .brand-logo {
  height: 30px;
}

.legal-header .brand-logo {
  height: 28px;
}

.auth-hero .brand-logo {
  height: 40px;
}

.auth-mobile-brand .brand-logo {
  height: 34px;
}

@media (max-width: 640px) {
  .legal-header .brand-logo {
    height: 24px;
  }
}

/* ===================== Pro plan & Pro Tools ===================== */
.tier-chip {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.tier-chip.is-pro {
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  color: #fff;
  box-shadow: 0 3px 8px rgba(232, 147, 12, 0.3);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.pm-plan.is-pro {
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  color: #fff;
}

.status-badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

/* Subscription page: plan groups */
.plan-group+.plan-group {
  margin-top: 18px;
}

.plan-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
}

.plan-group-pro .plan-card {
  background: linear-gradient(135deg, #fffaf0, #fff);
}

.plan-badge-pro {
  background: linear-gradient(135deg, #0f8a6c, #0b6b55);
  box-shadow: 0 4px 10px rgba(11, 122, 99, 0.3);
}

.features-pro-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-list-pro li::before {
  content: "★";
  background: #fff3d9;
  color: #c47a09;
}

.feature-list li {
  transition: color 0.2s, opacity 0.2s;
}

/* Plus selected: Pro-only features look locked */
.features-panel.is-plus .features-pro-title {
  opacity: 1;
}

/* heading stays clear; only the Pro items below are faded */
.features-panel.is-plus .feature-list-pro li {
  color: var(--muted);
  opacity: 0.55;
}

/* not in Plus: simply disabled (no strike-through) */
.features-panel.is-plus .feature-list-pro li::before {
  content: "★";
  background: #eef0f2;
  color: #9aa4a0;
}

/* Pro selected: Pro features fully included */
.features-panel.is-pro .feature-list-pro li {
  font-weight: 500;
}

.features-upsell {
  margin-top: 16px;
  width: 100%;
  padding: 10px 14px;
  border: 1px dashed #e2b25a;
  border-radius: var(--r-md, 10px);
  background: #fff8ea;
  color: #8a5a06;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.features-upsell:hover {
  background: #fff1d3;
}

/* Hub */
.pro-group {
  margin-top: 22px;
}

.pro-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.pro-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.pro-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cfe5dd;
}

.pro-tile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pro-tile-text b {
  font-size: 15px;
}

.pro-tile-text small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.pro-tile-text em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 4px;
}

.pro-tile-go {
  color: var(--muted);
  margin-top: 10px;
}

.pro-tile.is-locked {
  opacity: 0.85;
}

.pro-tile.is-locked .pro-icon {
  filter: grayscale(0.4);
}

.pro-lock {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff3d9;
  color: #c47a09;
}

.pro-lock .icon {
  width: 15px;
  height: 15px;
}

.pro-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.pro-icon .icon {
  width: 20px;
  height: 20px;
}

.pro-icon.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.pro-icon.sm .icon {
  width: 17px;
  height: 17px;
}

/* Module page */
.pro-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 18px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

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

.pro-tabs a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.pro-tabs a .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.pro-tabs a:hover {
  background: var(--surface-alt);
  color: var(--primary-dark);
}

.pro-tabs a.is-on {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.pro-tabs a.is-on .icon {
  color: #fff;
}

.pro-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pro-h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin: 18px 0 10px;
}

.pro-h2 .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.panel>.pro-h2:first-child {
  margin-top: 0;
}

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

.pro-small {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
}

.pro-small .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

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

.pro-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pro-toolbar .search-field {
  max-width: 420px;
}

.pro-select {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 220px;
}

.pro-select select {
  min-width: 220px;
}

.pro-overall {
  flex: 1;
  min-width: 220px;
  font-size: 13.5px;
  color: var(--muted);
}

.pro-overall b {
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--primary-dark);
  margin-right: 4px;
}

.pro-stats {
  margin-bottom: 16px;
}

.btn-sm {
  min-height: 34px !important;
  padding: 6px 11px !important;
  font-size: 13px !important;
  gap: 6px;
}

.btn-sm .icon {
  width: 15px;
  height: 15px;
}

[data-danger]:hover {
  background: var(--red-soft) !important;
  color: var(--red) !important;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

.chip em {
  font-style: normal;
  font-size: 12px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
}

.chip:hover {
  border-color: #bfe0d4;
}

.chip.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip.is-on em {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.pro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.pro-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pro-card>header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pro-card>header>div {
  flex: 1;
  min-width: 0;
}

.pro-card h3 {
  font-size: 16px;
}

.pro-card header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.pro-card>footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.pro-card .avatar {
  width: 40px;
  height: 40px;
}

.pro-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--text-2);
}

.pro-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-meta .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: none;
}

.pro-desc {
  font-size: 14px;
  color: var(--text-2);
}

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

.pro-tags span {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-2);
}

.pro-stat-line {
  font-size: 13.5px;
  color: var(--muted);
}

.pro-stat-line b {
  font-size: 18px;
  color: var(--text);
  margin-right: 4px;
}

.pro-stat-line .pro-bar {
  margin-top: 6px;
}

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

.pro-two small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.pro-two b {
  font-size: 17px;
}

.pro-two .pro-bar {
  margin-top: 6px;
}

.pro-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.pro-pct {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--primary-dark);
}

.pro-bar {
  height: 8px;
  border-radius: 999px;
  background: #e7eeeb;
  overflow: hidden;
}

.pro-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-grad);
  transition: width 0.3s;
}

.pro-bar.is-blue span {
  background: linear-gradient(90deg, #4f8ef0, var(--blue));
}

.pro-bar.is-amber span {
  background: linear-gradient(90deg, #f2b84b, var(--amber));
}

.pro-bar.is-red span {
  background: var(--red);
}

/* Syllabus */
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.chapter-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.chapter-list li:last-child {
  border-bottom: 0;
}

.chapter-list li>span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chapter-list small {
  font-size: 12px;
  color: var(--muted);
}

.chapter-status {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  flex: none;
}

.chapter-status .status-badge {
  min-width: 92px;
  justify-content: center;
}

.icon-mini {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-mini:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.icon-mini.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.icon-mini .icon {
  width: 16px;
  height: 16px;
}

/* Schedule week grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.day-col {
  min-height: 160px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-col h3 {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-col h3 em {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.day-col.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.day-empty {
  color: #b3bdb9;
  font-size: 13px;
}

.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.slot:hover {
  background: #d9f0e6;
}

.slot b {
  font-size: 13px;
}

.slot span {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

.slot small {
  font-size: 12px;
  color: var(--muted);
}

.slot.has-clash {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.slot i {
  position: absolute;
  top: 6px;
  right: 8px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--red);
}

/* Materials */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-alt);
}

.file-list li>div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-list b {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list small {
  font-size: 12px;
  color: var(--muted);
}

.file-ic {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff3d9;
  color: var(--amber);
}

.file-ic .icon {
  width: 17px;
  height: 17px;
}

.file-actions {
  display: flex;
}

/* Results / ranks */
.mark-input {
  width: 100px !important;
  min-height: 36px !important;
  padding: 6px 10px !important;
  text-align: center;
  font-weight: 600;
}

.mark-input.is-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(209, 74, 66, 0.15) !important;
}

.directory-panel>.form-actions {
  margin-top: 16px;
}

.rank-cell {
  font-size: 18px;
}

tr.is-top td {
  background: #fffaf0;
}

td .pro-bar {
  margin-top: 5px;
  max-width: 160px;
}

/* Leaderboard */
.podium-panel {
  margin-bottom: 14px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  max-width: 620px;
  margin: 0 auto;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.podium-col .avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.podium-col b {
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-col small {
  font-size: 12px;
  color: var(--muted);
}

.podium-medal {
  font-size: 26px;
  line-height: 1;
}

.podium-block {
  width: 100%;
  margin-top: 6px;
  border-radius: 12px 12px 4px 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.place-1 .podium-block {
  height: 110px;
  background: linear-gradient(180deg, #f6c34a, #e39a12);
}

.place-2 .podium-block {
  height: 80px;
  background: linear-gradient(180deg, #c7d0cc, #98a6a0);
}

.place-3 .podium-block {
  height: 62px;
  background: linear-gradient(180deg, #e3a274, #c07443);
}

.place-1 .avatar {
  width: 64px;
  height: 64px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #f6c34a;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.lb-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-alt);
}

.lb-list li>div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lb-list small {
  font-size: 12.5px;
  color: var(--muted);
}

.lb-score {
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--primary-dark);
}

.lb-score.up {
  color: var(--green);
}

/* Performance */
.insight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid;
}

.insight .icon {
  width: 22px;
  height: 22px;
}

.insight small {
  display: block;
  font-size: 12.5px;
}

.insight b {
  font-size: 16px;
}

.insight.good {
  background: var(--green-soft);
  border-color: #c7ebd9;
  color: #0f5f45;
}

.insight.weak {
  background: var(--red-soft);
  border-color: #f1c8c4;
  color: #8e2a24;
}

.perf-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.perf-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
}

.perf-head span {
  font-weight: 700;
}

.perf-bars .pro-bar {
  height: 12px;
}

.perf-bars small {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Notices */
.notice-list {
  display: grid;
  gap: 12px;
}

.notice-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-card>header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notice-card h3 {
  font-size: 16px;
}

.notice-card header p {
  font-size: 13px;
  color: var(--muted);
}

.notice-card.is-pinned {
  border-color: #f3dfae;
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.notice-msg {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.pin {
  font-style: normal;
  font-size: 12px;
  color: #9a6a12;
  margin-left: 6px;
}

/* Pro form dialog */
.pro-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 40px);
  padding: 0;
}

.pro-form {
  display: block;
  padding: 22px;
  container-type: inline-size;
}

.pro-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pro-dialog-head h2 {
  font-size: 20px;
}

.pro-dialog-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

.pro-dialog .dialog-close {
  margin: 0;
}

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

@container (max-width: 480px) {
  .pro-form-grid {
    grid-template-columns: 1fr;
  }
}

.check-list {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px 12px;
  margin: 0;
  min-width: 0;
}

.check-list legend {
  padding: 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.check-tools {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
}

.check-item:hover {
  background: var(--surface-alt);
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: none;
}

/* "WhatsApp par bhejo" dialog (js/app.js → sendList) */
.send-dialog {
  width: min(560px, calc(100% - 24px));
}

.send-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.send-group .button {
  flex: 1 1 200px;
}

.send-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #8a5a06;
  background: #fff8ea;
  border-radius: 8px;
  padding: 8px 10px;
  margin: -4px 0 14px;
}

.send-hint .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}

.send-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.send-head b {
  font-size: 14px;
}

.send-head small {
  font-size: 12.5px;
  color: var(--muted);
}

.send-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.send-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft, #eef1f0);
}

.send-list li:last-child {
  border-bottom: 0;
}

.send-list li>div {
  flex: 1;
  min-width: 0;
}

.send-list li b,
.send-list li small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-list li b {
  font-size: 14px;
}

.send-list li small {
  font-size: 12.5px;
  color: var(--muted);
}

.send-list .is-sent {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}

.send-nophone {
  font-size: 12px;
  color: var(--muted);
}

/* Attendance: absent → ask reason */
.panel-heading>.panel-heading-actions {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attendance-row {
  flex-wrap: wrap;
}

.absent-extra {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 50px;
}

.absent-reason {
  flex: 1 1 200px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text);
}

.absent-reason:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: transparent;
}

.record-actions {
  margin-top: 10px;
}

.icon-mini.is-send {
  color: var(--green);
}

@media (max-width: 640px) {
  .absent-extra {
    padding-left: 0;
  }

  .panel-heading>.panel-heading-actions {
    width: 100%;
  }

  .panel-heading-actions .button {
    flex: 1;
  }
}

/* Locked (no Pro) */
.pro-locked-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 36px 24px;
  margin-bottom: 8px;
  border-radius: var(--r-xl);
  background: radial-gradient(120% 80% at 50% 0%, #fff4dc 0%, #fff 60%);
  border: 1px solid #f3dfae;
}

.pro-locked-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  color: #fff;
  box-shadow: 0 10px 24px rgba(232, 147, 12, 0.35);
}

.pro-locked-icon .icon {
  width: 32px;
  height: 32px;
}

.pro-locked-hero h1 {
  font-size: 28px;
  font-weight: 800;
  max-width: 640px;
}

.pro-locked-hero p {
  color: var(--muted);
  max-width: 560px;
}

.pro-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pro-price strong {
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 800;
}

.pro-price span {
  color: var(--muted);
}

.pro-price em {
  font-style: normal;
  font-size: 13.5px;
  color: #9a6a12;
  margin-left: 6px;
}

.pro-locked-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 640px) {
  .pro-head-actions {
    width: 100%;
  }

  .pro-head-actions .button {
    flex: 1;
  }

  .pro-select,
  .pro-select select {
    min-width: 0;
    width: 100%;
  }

  .pro-toolbar>* {
    flex: 1 1 100%;
  }

  .pro-meta {
    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(140px, 1fr));
  }

  .pro-form {
    padding: 18px;
  }

  .pro-locked-hero h1 {
    font-size: 22px;
  }

  .podium-block {
    font-size: 20px;
  }

  .place-1 .podium-block {
    height: 86px;
  }

  .place-2 .podium-block {
    height: 64px;
  }

  .place-3 .podium-block {
    height: 50px;
  }
}

@media print {

  .pro-tabs,
  .pro-head-actions,
  .pro-toolbar,
  .back-link,
  .cell-actions,
  .directory-panel>.form-actions {
    display: none !important;
  }
}

/* Legal & contact pages (open to everyone) ------------------------------- */
.legal-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-bar {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.legal-header .legal-bar {
  min-height: 66px;
}

.legal-main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}

.legal-doc {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
}

.legal-doc.legal-wide {
  max-width: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.legal-doc h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
}

.legal-doc h2 {
  font-size: 18px;
  margin: 26px 0 8px;
}

.legal-doc p,
.legal-doc li {
  color: var(--text-2);
  font-size: 15px;
}

.legal-doc p {
  margin: 0 0 10px;
}

.legal-doc ul {
  margin: 0 0 10px;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.legal-doc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;   /* long running text: links stay visible */
  text-underline-offset: 2px;
}

.legal-doc a:hover {
  text-decoration: underline;
}

.legal-doc .eyebrow {
  color: var(--primary);
}

.legal-updated {
  color: var(--muted) !important;
  font-size: 13.5px !important;
  margin-bottom: 20px !important;
}

.legal-lead {
  font-size: 16px !important;
  color: var(--muted) !important;
  margin-bottom: 22px !important;
}

.legal-summary {
  margin: 4px 0 8px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--green-soft);
  border: 1px solid #c7ebd9;
}

.legal-summary b {
  color: #0f5f45;
}

.legal-summary ul {
  margin: 8px 0 0;
}

.biz-missing {
  background: #fff3c4;
  color: #7a5310 !important;
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.contact-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-content: start;
}

.contact-card > * {
  grid-column: 2;
}

.contact-card > .heading-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.contact-card h2 {
  font-size: 16px;
  margin: 0;
  line-height: 1.4;
}

.contact-card p[data-biz="hours"] {
  font-size: 13px;
}

.contact-card a {
  font-size: 15.5px;
  overflow-wrap: anywhere;
}

.contact-card .biz-phones {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-card .biz-phones a {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.contact-card .biz-sep {
  display: none;
}

.contact-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.contact-form-panel h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.contact-form-panel>p {
  color: var(--muted);
  margin-bottom: 16px;
}

.legal-links-inline {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted) !important;
}

.legal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.legal-footer .legal-bar {
  padding-top: 18px;
  padding-bottom: 20px;
  font-size: 13.5px;
  color: var(--muted);
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.legal-footer nav a {
  color: var(--text-2);
  font-weight: 500;
}

.legal-footer nav a:hover,
.legal-footer nav a[aria-current="page"] {
  color: var(--primary);
}

/* Small legal links under the login form */
.auth-legal {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 12px;
  font-size: 12.5px;
}

.auth-legal a {
  color: var(--muted);
}

.auth-legal a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.pay-terms {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.pay-terms a {
  color: var(--primary);
  font-weight: 600;
}

/* 10. Responsive --------------------------------------------------------- */
/* Laptops (sidebar visible but content < ~1060px): 4-up / 3-up rows get too tight */
@media (max-width: 1420px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 1200px) {
  :root {
    --sidebar-w: 240px;
    --gutter: 20px;
  }

  .dash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  }
}

@media (max-width: 920px) {
  :root {
    --gutter: 16px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  body.nav-open {
    overflow: hidden;
  }

  .drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(14, 30, 25, 0.4);
  }

  body.nav-open .drawer-scrim {
    display: block;
  }

  .menu-button {
    display: grid;
  }

  :root {
    --header-h: 62px;
  }

  .topbar {
    gap: 10px;
  }

  .global-search {
    flex: 1;
  }

  .header-profile>span,
  .profile-chevron {
    display: none;
  }

  .header-profile {
    padding: 2px;
  }

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

  .dash-side {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }

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

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

  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-grid .checkout-panel {
    order: 0;
  }

  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-panel {
    align-items: start;
    background:
      radial-gradient(ellipse at 0% 0%, #dff4ec 0, transparent 55%),
      var(--surface);
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 14px;
  }

  body {
    font-size: 14px;
  }

  :root {
    --header-h: 58px;
  }

  .global-search {
    height: 40px;
    padding: 0 12px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .top-actions {
    gap: 8px;
  }

  .content {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .page-title-row {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 18px;
  }

  .page-title-row h1 {
    font-size: 22px;
  }

  .page-title-row>.button {
    width: 100%;
  }

  .date-field {
    justify-content: space-between;
  }

  .date-field input {
    flex: 1;
  }

  .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dash-actions .button {
    flex-direction: column;
    gap: 4px;
    min-height: 58px;
    padding: 8px 4px;
    font-size: 12px;
    white-space: normal;
    text-align: center;
  }

  .dash-actions .button .icon {
    width: 18px;
    height: 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  .compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
  }

  .stat-card:hover {
    transform: none;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .stat-icon .icon {
    width: 19px;
    height: 19px;
  }

  .stat-card small {
    font-size: 12px;
  }

  .stat-card b {
    font-size: 20px;
  }

  .stat-card>div>span {
    font-size: 11.5px;
  }

  .compact-stats .stat-card b {
    font-size: 18px;
  }

  .panel {
    padding: 16px;
  }

  .panel-heading>.button,
  .account-panel>.button,
  .contact-panel>.button {
    width: 100%;
  }

  .directory-tools {
    flex-direction: column;
  }

  .search-field {
    max-width: none;
    flex: none;
  }

  .filter-label select {
    width: 100%;
  }

  .form-panel {
    padding: 18px;
  }

  .form-actions .button {
    flex: 1;
  }

  .attendance-row {
    flex-wrap: wrap;
  }

  .attendance-options {
    width: 100%;
  }

  .attendance-options button {
    flex: 1;
  }

  .student-heading {
    padding: 18px;
  }

  .profile-actions {
    margin-left: 0;
    width: 100%;
  }

  .profile-actions .button {
    flex: 1;
  }

  .detail-sections {
    grid-template-columns: 1fr;
  }

  .report-tabs {
    display: flex;
  }

  .report-tabs button {
    flex: 1;
  }

  .report-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .report-controls label {
    min-width: 0;
  }

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

  .report-card {
    padding: 14px;
  }

  .report-card strong {
    font-size: 22px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .plan-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .plan-amount strong {
    font-size: 26px;
  }

  .plan-amount span {
    font-size: 12.5px;
  }

  .plan-billed {
    font-size: 12.5px;
  }

  .sub-status {
    padding: 18px;
    gap: 14px;
    align-items: flex-start;
  }

  .sub-status-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .sub-status-title h2 {
    font-size: 18px;
  }

  .renew-banner .button {
    width: 100%;
  }

  .legal-doc {
    padding: 22px 18px;
  }

  .legal-doc h1 {
    font-size: 26px;
  }

  .legal-doc.legal-wide {
    padding: 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .legal-header .button {
    padding: 8px 12px;
  }

  .auth-panel {
    padding: 28px 18px;
  }

  .auth-form h2 {
    font-size: 23px;
  }

  .toast-region {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 12px;
  }

  .field-pair {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card b {
    font-size: 18px;
  }

  .compact-stats .stat-icon {
    display: none;
  }

  .page-title-row h1 {
    font-size: 21px;
  }
}

/* Very small phones (old / compact devices) */
@media (max-width: 330px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .top-actions .notification-button,
  .top-actions .feedback-button {
    display: none;
  }

  .table-scroll tr {
    grid-template-columns: 1fr;
  }

  .report-cards {
    grid-template-columns: 1fr;
  }
}

/* Normal laptop heights: medium spacing so the whole menu fits without scrolling */
@media (max-height: 860px) {

  .side-nav,
  .nav-section {
    gap: 4px;
  }

  .side-nav a {
    height: 38px;
  }
}

/* Short screens (small laptops, zoomed browsers): tighter sidebar so the whole menu stays visible */
@media (max-height: 720px) {
  .sidebar {
    padding-bottom: 10px;
  }

  .sidebar>.brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .side-nav,
  .nav-section {
    gap: 2px;
  }

  .side-nav a {
    height: 34px;
  }

  .trial-tile {
    padding: 7px 12px;
  }

  .trial-tile small {
    display: none;
  }

  .side-profile {
    padding: 4px 8px;
  }

  .side-profile i {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* Large screens: give content a little more room */
@media (min-width: 1600px) {
  :root {
    --content-max: 1400px;
    --gutter: 36px;
  }
}

/* Short landscape phones: do not pin the topbar so content has room */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar {
    position: static;
  }

  .sidebar {
    overflow-y: auto;
  }

  .auth-panel {
    align-items: start;
  }
}

/* Touch devices: comfortable tap targets, no hover lift */
@media (hover: none) and (pointer: coarse) {

  /* 16px inputs stop iPhone Safari from zooming in on focus */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .button {
    min-height: 44px;
  }

  .side-nav a {
    height: 42px;
  }

  .attendance-options button {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {

  .sidebar,
  .topbar,
  .app-footer,
  .bottom-nav,
  .drawer-scrim,
  .skip-link {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  body {
    background: #fff;
  }

  .panel,
  .stat-card,
  .report-card {
    box-shadow: none;
  }
}

/* Cloud mode: data is loading from the server */
body.is-loading main.content> :not(.renew-banner) {
  visibility: hidden;
}

body.is-loading main.content {
  position: relative;
  min-height: 60vh;
}

body.is-loading main.content::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 120px;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: cs-spin 0.8s linear infinite;
}

@keyframes cs-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loading main.content::before {
    animation-duration: 2.4s;
  }
}

.otp-input {
  letter-spacing: 0.5em;
  font-size: 18px !important;
  font-weight: 700;
}

/* Bottom navigation — phones and tablets (the sidebar becomes a drawer opened by "More") */
@media (max-width: 920px) {
  .bottom-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    /* even columns, also when a role hides an item */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border);
  }

  .bottom-nav a,
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 4px 2px;
    border: 0;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
  }

  .bottom-nav .icon {
    width: 22px;
    height: 22px;
  }

  .bottom-nav .active {
    color: var(--primary);
  }

  .bottom-nav .active .icon {
    stroke-width: 2.4;
  }

  .bottom-nav a:hover,
  .bottom-nav button:hover {
    color: var(--primary-dark);
  }

  body.has-bottom-nav {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  body.has-bottom-nav .toast-region {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .app-footer {
    justify-content: center;
    text-align: center;
  }
}

@media print {
  .bottom-nav {
    display: none !important;
  }

  body.has-bottom-nav {
    padding-bottom: 0;
  }
}

/* Dashboard on phones/tablets: one column, "Today" right after the task list */
@media (max-width: 920px) {

  .dash-main,
  .dash-side {
    display: contents;
  }

  .dash-grid>*>.panel:nth-child(1) {
    order: 1;
  }

  .dash-side>.panel:nth-child(1) {
    order: 2;
  }

  .dash-main>.panel:nth-child(2) {
    order: 3;
  }

  .dash-side>.panel:nth-child(2) {
    order: 4;
  }
}

@media (max-width: 640px) {
  .kpi-grid .stat-icon {
    display: none;
  }

  .kpi-grid .stat-card {
    padding: 12px 14px;
  }
}

/* Table helpers */
.compact-only {
  display: none;
}

.table-actions {
  align-items: center;
}

.table-actions .icon-button {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.paid-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.paid-note .icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 1200px) {
  .header-profile small {
    display: none;
  }
}

/* ===================== Plans & roles (Plus / Pro) ===================== */
.muted-note {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.cell-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.report-tabs .tier-chip {
  font-size: 9.5px;
  padding: 1px 5px;
  vertical-align: 1px;
  margin-left: 2px;
  box-shadow: none;
}

.report-tabs {
  flex-wrap: wrap;
}

/* Teacher / staff logins: fee columns and admin-only actions are not shown (the server refuses them anyway) */
body.is-teacher .table-scroll td[data-label="Monthly fee"],
body.is-teacher .table-scroll td[data-label="Fee status"] {
  display: none;
}

body[data-page="students"].is-teacher thead th:nth-child(5),
body[data-page="students"].is-teacher thead th:nth-child(6) {
  display: none;
}

body.is-teacher #student-filter option[value="due"] {
  display: none;
}

.pro-body.is-readonly [data-act="edit"],
.pro-body.is-readonly [data-act="del"],
.pro-body.is-readonly [data-act="add"] {
  display: none;
}

/* Teacher logins (Settings) */
.team-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.team-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
}

.team-list li>div {
  flex: 1;
  min-width: 0;
}

.team-list b {
  display: block;
}

.team-list small {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.team-form {
  margin-top: 6px;
  align-items: end;
}

/* Analytics (Pro) */
.ins-filters {
  flex-wrap: wrap;
}

.ins-kpis {
  margin-bottom: 4px;
}

.ins-bar {
  display: block;
  height: 5px;
  margin-top: 5px;
  max-width: 140px;
  border-radius: 99px;
  background: var(--border-soft);
  overflow: hidden;
}

.ins-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.ins-bar.is-blue i {
  background: var(--blue);
}

.ins-bar.is-amber i {
  background: var(--amber);
}

.ins-change {
  font-weight: 700;
}

.ins-change.is-up {
  color: var(--green);
}

.ins-change.is-down {
  color: var(--red);
}

.ins-funnel {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Dashboard insights (Pro) */
#pro-insights {
  margin-bottom: 16px;
}

.ins-dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.ins-mini {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  min-width: 0;
}

.ins-mini small,
.ins-mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ins-mini b {
  display: block;
  margin: 2px 0;
  font-family: var(--font-head);
  font-size: 20px;
}

.ins-spark {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 90px;
  margin-top: 14px;
}

.ins-spark-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ins-spark-col span {
  display: block;
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-ring);
}

.ins-spark-col small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 720px) {
  .ins-dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Pro dashboard: the whole process, admission → results (insights.js renderProcess) */
#pro-process {
  margin-bottom: 16px;
}

.proc-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.proc-steps::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-ring), #f3d39a);
}

/* the line the steps sit on */
.proc-steps li {
  position: relative;
  min-width: 0;
}

.proc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  padding: 10px 4px 12px;
  border-radius: var(--r-md);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: background .15s;
}

.proc-step:hover {
  background: var(--surface-alt);
}

.proc-step:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 1px;
}

.proc-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border: 2px solid var(--primary-ring);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
}

.proc-icon .icon {
  width: 19px;
  height: 19px;
}

.proc-icon em {
  position: absolute;
  top: -5px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}

.proc-step b {
  font-size: 13.5px;
}

.proc-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.proc-step.is-alert .proc-icon {
  border-color: #f0b75a;
  background: #fff6e3;
  color: #c97a06;
}

.proc-step.is-alert small {
  color: #b86e05;
  font-weight: 600;
}

@media (max-width: 980px) {
  .proc-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 4px;
  }

  .proc-steps::before {
    display: none;
  }
}

@media (max-width: 480px) {

  /* phones: still 4 per row, just smaller */
  .proc-steps {
    gap: 2px;
  }

  .proc-step {
    padding: 8px 0 10px;
  }

  .proc-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 4px;
  }

  .proc-icon .icon {
    width: 17px;
    height: 17px;
  }

  .proc-step b {
    font-size: 12px;
  }

  .proc-step small {
    font-size: 10.5px;
  }
}

/* Parent portal (Pro, view only) */
.parent-page {
  background: var(--surface-alt);
}

.parent-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.parent-header .legal-bar {
  gap: 12px;
}

.parent-child-head {
  margin-bottom: 14px;
}

.parent-tabs {
  margin-bottom: 16px;
}

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

.parent-fee-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 12px;
}

.parent-fee-note .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--amber);
}

.parent-table {
  width: 100%;
}

.notice-text {
  font-weight: 500;
  white-space: pre-line;
  text-align: right;
}

.parent-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 760px) {
  .parent-sections {
    grid-template-columns: 1fr;
  }

  .notice-text {
    text-align: left;
  }
}

.detail-line b small,
.parent-panel .detail-line small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.parent-panel .detail-line span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.parent-panel .detail-line b {
  flex: 0 1 auto;
  max-width: 60%;
  overflow-wrap: normal;
}

/* never split "₹1,500" */
.parent-panel .detail-line b .status-badge {
  white-space: nowrap;
}

/* "Choose a plan" dialog (planGate in js/app.js) */
.gate-dialog {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
}

.gate-body {
  position: relative;
  padding: 28px 26px 24px;
}

.gate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.gate-head {
  text-align: center;
  margin-bottom: 20px;
}

.gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.gate-icon .icon {
  width: 24px;
  height: 24px;
}

.gate-head h2 {
  font-size: 22px;
}

.gate-dialog .gate-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.gate-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gate-plan {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.gate-plan:hover {
  border-color: #b9d9cf;
  box-shadow: var(--shadow-sm);
}

.gate-plan:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.gate-plan.is-selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface) 55%);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.gate-radio {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid #c3d3ce;
  border-radius: 50%;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.gate-plan.is-selected .gate-radio {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px var(--surface);
  background: var(--primary);
}

.gate-plan-note {
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
}

.gate-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.gate-plan .tier-chip.is-pro {
  box-shadow: none;
}

.gate-plan-tag {
  margin-top: 10px;
  font-family: var(--font-head);
  font-size: 15px;
}

.gate-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 8px;
}

.gate-price strong {
  font-family: var(--font-head);
  font-size: 26px;
  line-height: 1.1;
}

.gate-price span {
  color: var(--muted);
  font-size: 13px;
}

.gate-yearly {
  color: var(--muted);
  font-size: 12px;
}

.gate-plan ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 7px;
}

.gate-plan li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.35;
}

.gate-plan li .icon {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--primary);
}

.gate-safe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.gate-safe .icon {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--green);
}

.gate-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.gate-actions .button {
  flex: 1;
  justify-content: center;
}

@media (max-width: 520px) {
  .gate-body {
    padding: 20px 16px 0;
  }

  .gate-close {
    top: 10px;
    right: 10px;
  }

  .gate-head {
    margin-bottom: 14px;
  }

  .gate-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 12px;
  }

  .gate-head h2 {
    font-size: 19px;
  }

  .gate-plans {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gate-plan {
    padding: 14px;
  }

  .gate-plan-tag {
    margin-top: 6px;
  }

  .gate-price strong {
    font-size: 22px;
  }

  .gate-plan ul {
    margin-top: 10px;
    padding-top: 10px;
    gap: 5px;
  }

  .gate-safe {
    margin-top: 12px;
  }

  /* buttons stay visible while the plans scroll */
  .gate-actions {
    position: sticky;
    bottom: 0;
    flex-direction: column;
    gap: 8px;
    margin: 12px -16px 0;
    padding: 12px 16px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
  }
}

/* Subscription page — plan picker (renderPlanPicker in js/app.js) */
.plan-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.plan-picker-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.cycle-toggle {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.cycle-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cycle-toggle button:hover {
  color: var(--primary-dark);
}

.cycle-toggle button.is-on {
  background: var(--primary);
  color: #fff;
}

.cycle-toggle button:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 1px;
}

.cycle-toggle em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.cycle-toggle button.is-on em {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

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

.tier-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.tier-card:hover {
  border-color: #b9d9cf;
  box-shadow: var(--shadow-sm);
}

.tier-card:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.tier-card.is-selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface) 50%);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.tier-card.is-selected .gate-radio {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px var(--surface);
  background: var(--primary);
}

.tier-card .tier-chip.is-pro {
  box-shadow: none;
}

.tier-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-card-top .gate-radio {
  margin-left: auto;
}

.tier-current {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}

.tier-card-tag {
  margin-top: 12px;
  font-family: var(--font-head);
  font-size: 17px;
}

.tier-card-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.tier-card .gate-price {
  margin-top: 12px;
}

.tier-card .gate-price strong {
  font-size: 30px;
}

.tier-card ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 8px;
}

.tier-card li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.35;
}

.tier-card li .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--primary);
}

@media (max-width: 640px) {
  .tier-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tier-card {
    padding: 16px;
  }

  .tier-card ul {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cycle-toggle {
    width: 100%;
  }

  .cycle-toggle button {
    flex: 1;
    justify-content: center;
  }
}

/* No plan yet is not an error: calm amber instead of red */
.sub-status.is-none {
  border-left-color: var(--amber);
  background: var(--surface);
}

.sub-status.is-none .sub-status-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

@media (min-width: 641px) {
  .tier-card-desc {
    min-height: 40px;
    line-height: 20px;
  }
}

/* both prices on one line when the cards sit side by side */

/* Plus locked while Pro runs (Pro already includes Plus) */
.tier-card.is-locked {
  cursor: default;
  background: var(--surface-alt);
  border-style: dashed;
}

.tier-card.is-locked:hover {
  border-color: var(--border);
  box-shadow: none;
}

.tier-card.is-locked .tier-card-tag,
.tier-card.is-locked .tier-card-desc {
  opacity: .75;
}

.tier-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tier-lock .icon {
  width: 14px;
  height: 14px;
}

.tier-locked-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.tier-locked-note .icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--primary);
}

/* Plus → Pro upgrade confirmation */
.upgrade-dialog {
  width: min(480px, calc(100% - 24px));
}

.upgrade-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.upgrade-fact {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  text-align: center;
  min-width: 0;
}

.upgrade-fact.is-pro {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upgrade-fact small,
.upgrade-fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.upgrade-fact b {
  display: block;
  margin: 3px 0;
  font-family: var(--font-head);
  font-size: 18px;
}

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

.upgrade-arrow .icon {
  width: 20px;
  height: 20px;
}

.upgrade-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--amber-soft);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.upgrade-note .icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--amber);
}

@media (max-width: 420px) {
  .upgrade-facts {
    grid-template-columns: 1fr;
  }

  .upgrade-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

/* Pro selected → golden highlight (matches the PRO chip); Plus keeps the green one */
.tier-card.tier-pro.is-selected {
  border-color: #e8a33c;
  background: linear-gradient(180deg, #fff6e3 0%, var(--surface) 60%);
  box-shadow: 0 0 0 3px rgba(232, 147, 12, 0.22), 0 10px 26px rgba(232, 147, 12, 0.16);
}

.tier-card.tier-pro.is-selected .gate-radio {
  border-color: #e8930c;
  background: #e8930c;
}

.tier-card.tier-pro:hover {
  border-color: #f0c47a;
}

.tier-card.tier-pro:focus-visible {
  outline-color: rgba(232, 147, 12, 0.35);
}

/* Subscription features: Plus (left) and Pro extras (right) side by side */
.features-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.features-col {
  min-width: 0;
}

.features-col-pro {
  padding-left: 24px;
  border-left: 1px solid var(--border-soft);
}

.features-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px !important;
  margin-bottom: 12px !important;
}

.features-col-title .tier-chip {
  box-shadow: none;
}

.features-panel .feature-list {
  gap: 8px;
}

.features-panel .feature-list li {
  font-size: 13.5px;
  gap: 8px;
  line-height: 1.4;
}

.features-panel .features-upsell {
  margin-top: 14px;
}

.features-panel {
  container-type: inline-size;
}

@container (max-width: 440px) {
  .features-cols {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .features-col-pro {
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }
}

/* Feature column headers: green Plus band, golden Pro band */
.features-col-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 96px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--r-md);
}

/* same height in both columns → lists start on one line */
.features-col-head h2 {
  margin: 2px 0 0 !important;
  font-size: 15px !important;
  line-height: 1.25;
}

.features-col-head small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.features-col-head .tier-chip {
  flex: none;
  box-shadow: none;
}

.features-col-head.is-plus {
  background: var(--primary-soft);
  border-color: #cfe7df;
}

.features-col-head.is-plus small {
  color: var(--primary-dark);
}

.features-col-head.is-pro {
  background: #fff6e3;
  border-color: #f3d9a4;
}

.features-col-head.is-pro small {
  color: #9a5b00;
}

.features-panel.is-pro .features-col-head.is-pro {
  box-shadow: 0 0 0 3px rgba(232, 147, 12, 0.15);
}

.features-panel.is-plus .features-col-head.is-plus {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.features-col-head.is-plus .tier-chip {
  background: var(--surface);
  border: 1px solid #cfe7df;
}

/* chip stays visible on the green band */

/* Plus → Pro upgrade confirmation (confirmUpgrade in js/app.js) */
.upgrade-dialog {
  width: min(560px, calc(100% - 24px));
}

.upg {
  position: relative;
  padding: 22px 26px 20px;
}

.upg-close {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.upg-hero {
  text-align: center;
}

.upg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid #f3d9a4;
  background: #fff4dc;
  color: #b86e00;
}

.upg-icon .icon {
  width: 26px;
  height: 26px;
}

.upg-hero h2 {
  font-size: 22px;
}

.upgrade-dialog .upg-hero p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.upgrade-dialog .upg-hero p b {
  color: var(--text);
}

.upg-plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}

.upg-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.upg-plan-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.upg-plan-top small {
  white-space: nowrap;
}

.upg-plan .tier-chip {
  box-shadow: none;
}

.upg-plan small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.upg-plan b {
  font-family: var(--font-head);
  font-size: 16px;
}

.upg-plan span:last-child {
  color: var(--muted);
  font-size: 12.5px;
}

.upg-plan.is-now {
  background: var(--surface-alt);
}

.upg-plan.is-now .tier-chip {
  background: var(--surface);
  border: 1px solid #cfe7df;
}

.upg-plan.is-now .tier-chip.is-pro {
  background: linear-gradient(135deg, #f6b73c, #e8930c);
  border: 0;
}

/* running Pro keeps its gold chip */
.upg-plan.is-next {
  border-color: #f0c47a;
  background: #fff8ea;
  box-shadow: 0 0 0 3px rgba(232, 147, 12, 0.12);
}

.upg-arrow {
  align-self: center;
  display: inline-flex;
  color: var(--muted);
}

.upg-arrow .icon {
  width: 20px;
  height: 20px;
}

.upg-points {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.upg-points li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
}

.upg-points li .icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--primary);
}

.upg-points li.is-info .icon {
  color: var(--amber);
}

.upg-points b {
  color: var(--text);
}

.upg-pay {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.upg-pay span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.upg-pay small {
  order: 2;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

/* "Pay today · plan  ₹199" on one line */
.upg-pay b {
  order: 3;
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--primary-dark);
}

.upg-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.upg-actions .button {
  flex: 1;
  justify-content: center;
}

@media (max-width: 480px) {
  .upgrade-dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .upg {
    padding: 20px 14px 0;
  }

  .upg-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
  }

  .upg-hero h2 {
    font-size: 20px;
  }

  .upg-plans {
    gap: 6px;
    margin-top: 16px;
  }

  .upg-plan {
    padding: 10px;
  }

  .upg-plan b {
    font-size: 14.5px;
  }

  .upg-points {
    margin-top: 14px;
    gap: 7px;
  }

  .upg-points li {
    font-size: 13px;
  }

  .upg-pay {
    margin-top: 14px;
    padding-top: 12px;
  }

  /* buttons stay visible while the details scroll */
  .upg-actions {
    position: sticky;
    bottom: 0;
    gap: 8px;
    margin: 14px -14px 0;
    padding: 12px 14px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
  }
}

@media (max-width: 340px) {
  .upg-plans {
    grid-template-columns: 1fr;
  }

  .upg-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

@media (max-width: 480px) {
  .upg-plan-top {
    gap: 6px;
  }

  .upg-plan-top small {
    font-size: 10.5px;
    letter-spacing: .02em;
  }

  .upg-actions .button {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.upg-pay span {
  white-space: nowrap;
}

@media (max-width: 360px) {
  .upg-pay small {
    display: none;
  }

  .upg-pay b {
    margin-left: auto;
  }
}

/* plan name is already on the Pro card */

/* Upgrade place: a Plus institute sees Pro's extras as benefits, not crossed out */
.features-panel.is-upgrade.is-plus .feature-list-pro li {
  opacity: 1;
  text-decoration: none;
  color: var(--text-2);
}

.features-panel.is-upgrade.is-plus .feature-list-pro li::before {
  content: "+";
  background: #fff3d9;
  color: #c47a09;
  font-weight: 800;
}



/* Account deactivated by Coaching Sathi (view-only) */
.gate-icon.is-danger {
  background: var(--red-soft);
  color: var(--red);
}

.suspended-gate {
  width: min(460px, calc(100% - 24px));
}

.sub-status.is-suspended {
  border-left-color: var(--red);
  background: linear-gradient(100deg, #fff5f4, #fff);
}

.sub-status.is-suspended .sub-status-icon {
  background: var(--red-soft);
  color: var(--red);
}

.sub-status.is-suspended .progress span {
  background: var(--red);
}

/* Plan cards (Subscription page): compact — tagline + price on one line, then description and billing note */
.tier-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "top top" "tag price" "desc desc" "note note";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 14px 18px;
}

.tier-card .tier-card-top {
  grid-area: top;
  margin-bottom: 8px;
}

.tier-card .tier-card-tag {
  grid-area: tag;
  margin-top: 0;
  font-size: 16px;
}

.tier-card .gate-price {
  grid-area: price;
  margin-top: 0;
  justify-self: end;
}

.tier-card .gate-price strong {
  font-size: 26px;
}

.tier-card .tier-card-desc {
  grid-area: desc;
  min-height: 0;
  margin-top: 2px;
  line-height: 1.4;
  font-size: 12.5px;
}

.tier-card .gate-yearly {
  grid-area: note;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.tier-card .tier-locked-note {
  grid-area: note;
  margin-top: 10px;
}

/* locked Plus: note sits under the text, not in the price slot */
@media (min-width: 641px) {
  .tier-card .tier-card-desc {
    min-height: 0;
  }
}

/* Planned features: a small "Coming soon" heading, then the items (muted, never shown as included) */
.feature-list li.soon-head {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9a6a10;
  opacity: 1 !important;
}

.feature-list li.soon-head {
  gap: 0;
}

.feature-list li.soon-head::before {
  content: none !important;
  display: none;
}

.feature-list li.is-soon {
  color: var(--muted);
  opacity: .75 !important;
}

.feature-list li.is-soon::before {
  content: "" !important;
  background: #fff4dc url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23b86e00%27 stroke-width=%272.4%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%279%27/%3E%3Cpath d=%27M12 7v5l3 2%27/%3E%3C/svg%3E") center / 13px 13px no-repeat !important;
}

/* clock = coming soon */

/* Plus renewal confirmation (Plus already running): green Plus look instead of the golden Pro one */
.upg-icon.is-plus {
  border-color: #cfe7df;
  background: var(--primary-soft);
  color: var(--primary);
}

.upg-plan.is-next-plus {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.upg-plan.is-next-plus .tier-chip {
  background: var(--surface);
  border: 1px solid #cfe7df;
  box-shadow: none;
}

/* Profile photo (header, sidebar, profile menu, Settings preview) */
#header-initial.has-photo,
#side-initial.has-photo,
#pm-initial.has-photo,
.avatar-preview.has-photo {
  padding: 0;
  background: var(--surface);
}

#header-initial.has-photo img,
#side-initial.has-photo img,
#pm-initial.has-photo img,
.avatar-preview.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
}

.avatar-preview {
  flex: none;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary-soft);
}

.avatar-edit-text {
  min-width: 0;
}

.avatar-edit-text b {
  display: block;
  font-size: 15px;
}

.avatar-edit-text small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.avatar-actions label.button {
  cursor: pointer;
}

/* 404 page */
.notfound-page {
  background: radial-gradient(ellipse at 0% 0%, #dff4ec 0, transparent 55%), var(--surface);
}

.notfound {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
  text-align: center;
}

.notfound-card {
  max-width: 460px;
}

.notfound-logo img {
  height: 34px;
  width: auto;
  margin: 0 auto 28px;
}

.notfound .notfound-code {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--primary);
}

.notfound h1 {
  font-size: 25px;
  font-weight: 800;
  margin: 14px 0 8px;
}

.notfound p {
  color: var(--muted);
  font-size: 15px;
}

.notfound-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ---------- Form controls: dropdowns, date & time pickers — the same clean look in every browser ----------
   Native pickers are kept on purpose (the phone's own calendar / clock: familiar, accessible, no extra script);
   only their look is styled. A tap anywhere on a date / time field opens the picker (see the app script). */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%235b687d%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m6%209%206%206%206-6%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px 18px;
  padding-right: 36px !important;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select:not([multiple]):not([size]):hover:not(:disabled):not(:focus) {
  border-color: var(--primary);
}

select::-ms-expand {
  display: none;
}

select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

select option {
  font-weight: 400;
}

input[type="date"],
input[type="time"],
input[type="month"],
input[type="week"],
input[type="datetime-local"] {
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]:hover:not(:disabled):not(:focus),
input[type="time"]:hover:not(:disabled):not(:focus),
input[type="month"]:hover:not(:disabled):not(:focus),
input[type="datetime-local"]:hover:not(:disabled):not(:focus) {
  border-color: var(--primary);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 20px;
  height: 20px;
  padding: 3px;
  margin-left: 6px;
  border-radius: 6px;
  color: transparent;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230b7a63%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2718%27%20rx%3D%273%27%2F%3E%3Cpath%20d%3D%27M16%202v4M8%202v4M3%2010h18%27%2F%3E%3C%2Fsvg%3E") center / 18px 18px no-repeat;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230b7a63%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%207v5l3%202%27%2F%3E%3C%2Fsvg%3E");
}

input::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(11, 122, 99, 0.12);
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="month"]::-webkit-datetime-edit-text {
  color: #8a94a6;
  padding: 0 2px;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #0b7a63;
  cursor: pointer;
}

input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid #cfd6e2;
  border-radius: 8px;
  background: #f5f7fb;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: rgba(11, 122, 99, 0.12);
  border-color: #0b7a63;
}

/* ---------- Dropdown list (the open list, not only the box) ----------
   Chrome / Edge 135+ let a <select> be styled completely ("customizable select"): rounded list, shadow, hover, a tick
   on the chosen option. Other browsers keep their own native list (still fully usable). Nothing changes for scripts:
   it is the same <select>, so every value / change handler keeps working. */
@supports (appearance: base-select) {

  select:not([multiple]):not([size]),
  select:not([multiple]):not([size])::picker(select) {
    appearance: base-select;
  }

  select:not([multiple]):not([size]) {
    background-image: none !important;
    padding-right: 12px !important;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  select:not([multiple]):not([size])::picker-icon {
    content: "";
    width: 18px;
    height: 18px;
    margin-left: auto;
    flex: none;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%235b687d%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m6%209%206%206%206-6%27%2F%3E%3C%2Fsvg%3E") center / 18px 18px no-repeat;
    transition: rotate 0.18s ease;
  }

  select:not([multiple]):not([size]):open::picker-icon {
    rotate: 180deg;
  }

  select:not([multiple]):not([size]):open {
    border-color: #0b7a63;
    box-shadow: 0 0 0 3px #e5f4ef;
  }

  select::picker(select) {
    border: 1px solid #dde3ec;
    border-radius: 12px;
    padding: 6px;
    margin-block: 6px;
    background: #fff;
    color: #1d2436;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    max-height: min(340px, 60vh);
    overflow-y: auto;
    min-width: anchor-size(width);
    opacity: 0;
    translate: 0 -4px;
    transition: opacity 0.14s ease, translate 0.14s ease, overlay 0.14s allow-discrete, display 0.14s allow-discrete;
  }

  select:open::picker(select) {
    opacity: 1;
    translate: 0 0;
  }

  @starting-style {
    select:open::picker(select) {
      opacity: 0;
      translate: 0 -4px;
    }
  }

  select option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
    color: #1d2436;
    cursor: pointer;
    white-space: normal;
    transition: background 0.1s;
  }

  select option:hover,
  select option:focus-visible {
    background: color-mix(in srgb, #e5f4ef 55%, #fff);
    color: #075c4a;
    outline: none;
  }

  select option:checked {
    background: #e5f4ef;
    color: #075c4a;
    font-weight: 600;
  }

  select option::checkmark {
    order: 1;
    margin-left: auto;
    content: "✓";
    color: #0b7a63;
    font-weight: 700;
  }

  select option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  select optgroup {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6a7385;
    padding: 8px 12px 4px;
  }
}

/* ---------- Date, month & time picker (js/datepicker.js) ---------- */
:root { --dp-accent: #0b7a63; --dp-soft: #e5f4ef; --dp-dark: #075c4a; }
html.dp-on input[type="date"]::-webkit-calendar-picker-indicator, html.dp-on input[type="month"]::-webkit-calendar-picker-indicator,
html.dp-on input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
html.dp-webkit input[type="date"], html.dp-webkit input[type="month"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230b7a63%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%274%27%20width%3D%2718%27%20height%3D%2718%27%20rx%3D%273%27%2F%3E%3Cpath%20d%3D%27M16%202v4M8%202v4M3%2010h18%27%2F%3E%3C%2Fsvg%3E") !important; background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 18px 18px !important; padding-right: 38px !important; }
html.dp-webkit input[type="time"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2718%27%20height%3D%2718%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%230b7a63%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%279%27%2F%3E%3Cpath%20d%3D%27M12%207v5l3%202%27%2F%3E%3C%2Fsvg%3E") !important; background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 18px 18px !important; padding-right: 38px !important; }
html.dp-on input[type="date"], html.dp-on input[type="month"], html.dp-on input[type="time"] { cursor: pointer; caret-color: transparent; }
.dp {
  position: fixed; inset: auto; margin: 0; z-index: 2147483000; width: 312px; max-width: calc(100vw - 16px); padding: 14px; box-sizing: border-box;
  background: #fff; color: #1d2436; border: 1px solid #e1e6ef; border-radius: 16px; overflow: visible;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18), 0 3px 10px rgba(15, 23, 42, 0.08);
  font: 400 14px/1.3 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  animation: dp-in 0.14s ease-out;
}
.dp:focus { outline: none; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dp button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dp button:focus-visible { outline: 2px solid var(--dp-accent); outline-offset: 1px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; font-weight: 700 !important; font-size: 15px !important; }
.dp-title:hover { background: #f2f4f8; }
.dp-title svg { color: #6a7385; }
.dp-nav { display: flex; gap: 2px; }
.dp-arrow { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #4a5263 !important; }
.dp-arrow:hover { background: var(--dp-soft); color: var(--dp-dark) !important; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-week span { font-size: 11.5px; font-weight: 600; color: #8a94a6; padding: 4px 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.dp-grid { row-gap: 2px; }
.dp-day { height: 38px; width: 38px; margin: 0 auto; border-radius: 50%; font-weight: 500; font-variant-numeric: tabular-nums; transition: background 0.1s; }
.dp-day:hover:not(:disabled) { background: var(--dp-soft); color: var(--dp-dark); }
.dp-day.is-other { color: #b3bac7; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--dp-accent); color: var(--dp-accent); font-weight: 700; }
.dp-day.is-selected, .dp-day.is-selected:hover { background: var(--dp-accent) !important; color: #fff !important; font-weight: 700; box-shadow: 0 4px 10px color-mix(in srgb, var(--dp-accent) 35%, transparent); }
.dp-day:disabled { color: #d2d7e0; cursor: not-allowed; text-decoration: line-through; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 0 2px; }
.dp-month { height: 46px; border-radius: 12px !important; font-weight: 600; background: #f6f7fa !important; }
.dp-month:hover:not(:disabled) { background: var(--dp-soft) !important; color: var(--dp-dark); }
.dp-month.is-today { box-shadow: inset 0 0 0 1.5px var(--dp-accent); color: var(--dp-accent); }
.dp-month.is-selected { background: var(--dp-accent) !important; color: #fff !important; }
.dp-month:disabled { opacity: 0.4; cursor: not-allowed; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0f5; }
.dp-foot-r { display: flex; gap: 6px; }
.dp-link { padding: 8px 10px; border-radius: 8px; font-weight: 600 !important; color: #5b687d !important; }
.dp-link:hover { background: #f2f4f8; color: #1d2436 !important; }
.dp-btn { padding: 8px 14px; border-radius: 9px; font-weight: 700 !important; background: var(--dp-accent) !important; color: #fff !important; }
.dp-btn:hover { filter: brightness(1.08); }
/* time */
.dp-time-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
.dp-time-big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #1d2436; }
.dp-time-big i { font-style: normal; color: var(--dp-accent); padding: 0 2px; }
.dp-ampm { display: inline-flex; padding: 3px; background: #f1f3f7; border-radius: 10px; }
.dp-ampm button { padding: 6px 12px; border-radius: 8px; font-weight: 700 !important; font-size: 13px !important; color: #6a7385 !important; }
.dp-ampm button.is-selected { background: #fff; color: var(--dp-accent) !important; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15); }
.dp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dp-cols small { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #8a94a6; margin: 0 0 6px 4px; }
.dp-col { height: 200px; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 4px; padding: 2px; scrollbar-width: thin; }
.dp-opt { height: 36px; border-radius: 9px; font-weight: 600; font-variant-numeric: tabular-nums; background: #f6f7fa !important; }
.dp-opt:hover { background: var(--dp-soft) !important; color: var(--dp-dark); }
.dp-opt.is-selected { background: var(--dp-accent) !important; color: #fff !important; }
/* phones: a bottom sheet */
.dp-back { position: fixed; inset: 0; margin: 0; width: auto; height: auto; max-width: none; max-height: none; border: 0; padding: 0; background: rgba(15, 23, 42, 0.35); z-index: 2147482999; animation: dp-fade 0.15s ease-out; }
@keyframes dp-fade { from { opacity: 0; } }
.dp.dp-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: dp-up 0.2s ease-out; }
.dp.dp-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d5dae3; margin: -6px auto 12px; }
.dp-sheet .dp-day { height: 44px; width: 44px; font-size: 15px; }
.dp-sheet .dp-col { height: 240px; }
.dp-sheet .dp-opt { height: 42px; }
@keyframes dp-up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dp, .dp-back, .dp.dp-sheet { animation: none; } }

/* Login / sign-up / OTP: fit common phone and laptop screens without page scrolling. Only spacing is tightened —
   every field, message, consent box and button stays visible; very short screens still scroll normally. */
.auth-split { min-height: 100svh; }

@media (min-width: 921px) and (max-height: 900px) {
  .auth-panel { padding-top: 24px; padding-bottom: 24px; }
  .auth-tabs { margin-bottom: 20px; }
  .auth-form { gap: 12px; }
  .auth-form header { margin-bottom: 0; }
  .auth-form h2 { font-size: 24px; margin-bottom: 4px; }
  .auth-form .field { gap: 5px; }
  .auth-form .input-group { height: 44px; }
  .auth-note { margin-top: 18px; padding-top: 14px; }
}

@media (max-width: 920px) {
  .auth-panel { padding-top: 18px; padding-bottom: 18px; }
  .auth-mobile-brand { margin-bottom: 14px; }
  .auth-tabs { margin-bottom: 16px; }
  .auth-form { gap: 11px; }
  .auth-form header { margin-bottom: 0; }
  .auth-form h2 { margin-bottom: 2px; }
  .auth-form header p { font-size: 14px; }
  .auth-form .field { gap: 5px; }
  .auth-form .input-group { height: 44px; }
  .auth-note { margin-top: 16px; padding-top: 12px; }
}

/* Shorter screens (768px laptops, most phones): a little less space around the form and its footer. */
@media (max-height: 820px) {
  .auth-panel { padding-top: 14px; padding-bottom: 14px; }
  .auth-tabs { margin-bottom: 14px; }
  .auth-tabs button { padding: 8px; }
  .auth-form { gap: 10px; }
  .auth-note { margin-top: 12px; padding-top: 10px; }
  .auth-legal { margin-top: 8px; }
}
