:root {
  --ezsd-navy: #071f49;
  --ezsd-blue: #1479ff;
  --ezsd-blue-dark: #0d62d6;
  --ezsd-bg: #f5f8fc;
  --ezsd-card: #ffffff;
  --ezsd-border: rgba(7, 31, 73, 0.10);
  --ezsd-border-strong: rgba(7, 31, 73, 0.16);
  --ezsd-muted: #68768d;
  --ezsd-danger: #bd3039;
  --ezsd-success: #16864c;
  --ezsd-warning: #a45a0a;
  --ezsd-shadow: 0 12px 34px rgba(7, 31, 73, 0.07);
  --ezsd-shadow-soft: 0 8px 24px rgba(7, 31, 73, 0.05);
}

.ezsd-shell,
.ezsd-shell * {
  box-sizing: border-box;
}

.ezsd-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto 64px;
  color: var(--ezsd-navy);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.ezsd-shell button,
.ezsd-shell input,
.ezsd-shell select,
.ezsd-shell textarea {
  font: inherit;
}

.ezsd-shell [hidden] {
  display: none !important;
}

/* Navigation */
.ezsd-app-nav {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 5px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 14px;
  box-shadow: var(--ezsd-shadow-soft);
  scrollbar-width: none;
}

.ezsd-app-nav::-webkit-scrollbar {
  display: none;
}

.ezsd-app-nav a {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 15px;
  align-items: center;
  justify-content: center;
  color: #59677d;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ezsd-app-nav a.is-active {
  color: #0b63d8;
  background: #eaf3ff;
}

.ezsd-app-nav a > span {
  display: block;
  width: 17px;
  height: 17px;
  margin-right: 7px;
  flex: 0 0 17px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.ezsd-nav-decks > span {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h12a2 2 0 0 1 2 2v14H7a2 2 0 0 1-2-2V3Zm2 2v10.17c.31-.11.65-.17 1-.17h9V5H7Zm1 12a1 1 0 0 0 0 2h9v-2H8Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h12a2 2 0 0 1 2 2v14H7a2 2 0 0 1-2-2V3Zm2 2v10.17c.31-.11.65-.17 1-.17h9V5H7Zm1 12a1 1 0 0 0 0 2h9v-2H8Z'/%3E%3C/svg%3E");
}

.ezsd-nav-plans > span {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v4H4V4Zm0 6h7v10H4V10Zm9 0h7v4h-7v-4Zm0 6h7v4h-7v-4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v4H4V4Zm0 6h7v10H4V10Zm9 0h7v4h-7v-4Zm0 6h7v4h-7v-4Z'/%3E%3C/svg%3E");
}

.ezsd-nav-billing > span {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm2 0v3h14V5H5Zm0 5v9h14v-9H5Zm2 3h5v2H7v-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm2 0v3h14V5H5Zm0 5v9h14v-9H5Zm2 3h5v2H7v-2Z'/%3E%3C/svg%3E");
}

/* Shared surfaces */
.ezsd-hero,
.ezsd-create-section,
.ezsd-decks-section,
.ezsd-deck-header,
.ezsd-study-panel,
.ezsd-manage-section,
.ezsd-notice-card,
.ezsd-plans-head,
.ezsd-plan-card,
.ezsd-billing-card,
.ezsd-invoices,
.ezsd-invoice {
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 22px;
  box-shadow: var(--ezsd-shadow);
}

.ezsd-eyebrow,
.ezsd-step {
  display: inline-flex;
  min-height: 27px;
  padding: 5px 10px;
  align-items: center;
  color: #0b63d8;
  background: #eaf3ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

/* Dashboard hero */
.ezsd-hero {
  display: flex;
  gap: 24px;
  padding: 28px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
}

.ezsd-hero-copy {
  max-width: 720px;
}

.ezsd-hero h1,
.ezsd-deck-header h1,
.ezsd-plans-head h1,
.ezsd-billing-section h1 {
  margin: 10px 0 7px;
  color: var(--ezsd-navy);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.038em;
}

.ezsd-hero p,
.ezsd-deck-header p,
.ezsd-plans-head p {
  margin: 0;
  color: var(--ezsd-muted);
  font-size: 16px;
  line-height: 1.6;
}

.ezsd-usage {
  flex: 0 0 168px;
  padding: 17px 18px;
  text-align: center;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--ezsd-border);
  border-radius: 17px;
}

.ezsd-usage span,
.ezsd-usage small {
  display: block;
  color: var(--ezsd-muted);
  font-size: 12px;
}

.ezsd-usage strong {
  display: block;
  margin: 4px 0;
  color: var(--ezsd-navy);
  font-size: 34px;
  line-height: 1;
}

/* Create deck */
.ezsd-create-section {
  width: min(900px, 100%);
  margin: 18px auto 0;
  padding: 24px;
}

.ezsd-panel-head,
.ezsd-section-head {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-panel-head h2,
.ezsd-section-head h2 {
  margin: 7px 0 0;
  color: var(--ezsd-navy);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.ezsd-dropzone {
  position: relative;
  display: flex;
  min-height: 132px;
  padding: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  cursor: pointer;
  background: #f8fbff;
  border: 1.5px dashed rgba(20,121,255,.36);
  border-radius: 17px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.ezsd-dropzone:hover {
  background: #f1f7ff;
  border-color: var(--ezsd-blue);
  transform: translateY(-1px);
}

.ezsd-dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ezsd-drop-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  align-items: center;
  justify-content: center;
  color: #0b63d8;
  background: #e7f1ff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
}

.ezsd-dropzone strong {
  font-size: 16px;
}

.ezsd-dropzone small,
.ezsd-selected-file {
  margin-top: 4px;
  color: var(--ezsd-muted);
  font-size: 12px;
}

.ezsd-selected-file {
  color: #0b63d8;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ezsd-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.ezsd-form-grid label,
.ezsd-editor-body label {
  display: flex;
  gap: 7px;
  min-width: 0;
  flex-direction: column;
}

.ezsd-field-wide {
  grid-column: span 2;
}

.ezsd-field-wide-tablet {
  grid-column: span 2;
}

.ezsd-form-grid label > span,
.ezsd-editor-body label > span {
  color: #34435c;
  font-size: 12px;
  font-weight: 850;
}

.ezsd-form-grid label > span small {
  color: #8791a1;
  font-weight: 600;
}

.ezsd-form-grid input,
.ezsd-form-grid select,
.ezsd-editor-body input,
.ezsd-editor-body textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ezsd-navy);
  background: #fff;
  border: 1px solid var(--ezsd-border-strong);
  border-radius: 12px;
  outline: none;
}

.ezsd-form-grid input:focus,
.ezsd-form-grid select:focus,
.ezsd-editor-body input:focus,
.ezsd-editor-body textarea:focus {
  border-color: rgba(20,121,255,.7);
  box-shadow: 0 0 0 3px rgba(20,121,255,.10);
}

.ezsd-field-help {
  color: var(--ezsd-muted);
  font-size: 11px;
  line-height: 1.45;
}

.ezsd-form-footer {
  display: flex;
  gap: 16px;
  margin-top: 17px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-checkline {
  display: flex;
  gap: 8px;
  margin: 0;
  align-items: flex-start;
  color: #59677d;
  font-size: 13px;
  line-height: 1.4;
}

.ezsd-checkline input {
  margin-top: 3px;
}

/* Buttons */
.ezsd-btn {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 17px;
  align-items: center;
  justify-content: center;
  color: inherit;
  border: 0;
  border-radius: 12px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.ezsd-btn:hover {
  transform: translateY(-1px);
}

.ezsd-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.ezsd-btn-primary {
  color: #fff;
  background: var(--ezsd-blue);
  box-shadow: 0 8px 20px rgba(20,121,255,.22);
}

.ezsd-btn-primary:hover {
  background: var(--ezsd-blue-dark);
}

.ezsd-btn-secondary {
  color: #0b63d8;
  background: #edf5ff;
}

.ezsd-btn-ghost {
  color: var(--ezsd-navy);
  background: #fff;
  border: 1px solid var(--ezsd-border);
}

.ezsd-btn-danger {
  color: var(--ezsd-danger);
  background: #fff0f1;
}

.ezsd-generate-btn {
  min-width: 150px;
}

/* Jobs and errors */
.ezsd-job-status {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  padding: 14px;
  align-items: center;
  background: #f1f6ff;
  border-radius: 13px;
}

.ezsd-job-status p {
  margin: 3px 0 0;
  color: var(--ezsd-muted);
  font-size: 13px;
}

.ezsd-spinner {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border: 3px solid rgba(20,121,255,.18);
  border-top-color: var(--ezsd-blue);
  border-radius: 50%;
  animation: ezsd-spin .8s linear infinite;
}

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

.ezsd-form-error,
.ezsd-error-box {
  margin-top: 15px;
  padding: 14px 15px;
  color: #9e252d;
  background: #fff0f1;
  border-radius: 13px;
}

.ezsd-error-box p {
  margin: 5px 0 0;
}

/* Deck library */
.ezsd-decks-section {
  margin-top: 18px;
  padding: 24px;
}

.ezsd-count-pill {
  display: inline-flex;
  padding: 7px 11px;
  color: #0b63d8;
  background: #edf5ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.ezsd-deck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.ezsd-deck-card {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 13px;
  padding: 15px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.ezsd-deck-card:hover {
  border-color: rgba(20,121,255,.28);
  box-shadow: var(--ezsd-shadow-soft);
}

.ezsd-deck-icon {
  position: relative;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: #0b63d8;
  background: #eaf3ff;
  border-radius: 13px;
}

.ezsd-deck-icon::before,
.ezsd-deck-icon::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ezsd-deck-icon::before {
  transform: translate(-3px, -3px);
  opacity: .45;
}

.ezsd-deck-icon::after {
  transform: translate(3px, 3px);
  background: #eaf3ff;
}

.ezsd-deck-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ezsd-muted);
  font-size: 11px;
}

.ezsd-status {
  font-weight: 850;
}

.ezsd-status-ready { color: var(--ezsd-success); }
.ezsd-status-error { color: var(--ezsd-danger); }

.ezsd-deck-body h3 {
  margin: 5px 0 3px;
  color: var(--ezsd-navy);
  font-size: 17px;
  line-height: 1.28;
}

.ezsd-deck-body p {
  margin: 0;
  color: var(--ezsd-muted);
  font-size: 13px;
}

.ezsd-deck-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.ezsd-icon-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--ezsd-danger);
  background: #fff0f1;
  border: 0;
  border-radius: 11px;
  font-size: 21px;
  cursor: pointer;
}

.ezsd-empty-state,
.ezsd-notice-card {
  padding: 38px 22px;
  text-align: center;
}

.ezsd-empty-state p,
.ezsd-notice-card p {
  max-width: 580px;
  margin: 7px auto 17px;
  color: var(--ezsd-muted);
}

.ezsd-notice-card {
  max-width: 680px;
  margin: 54px auto;
}

.ezsd-notice-card h2 {
  margin: 10px 0 5px;
  font-size: 30px;
  line-height: 1.15;
}

/* Deck study page */
.ezsd-back-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: #0b63d8;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.ezsd-deck-header {
  padding: 23px;
}

.ezsd-deck-header h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.ezsd-study-panel {
  width: min(920px, 100%);
  margin: 16px auto 0;
  padding: 18px;
  overflow: hidden;
}

.ezsd-study-toolbar {
  display: flex;
  gap: 14px;
  margin-bottom: 13px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-study-counter {
  display: flex;
  gap: 5px;
  align-items: baseline;
  color: var(--ezsd-muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.ezsd-study-counter strong {
  color: var(--ezsd-navy);
  font-size: 16px;
}

.ezsd-study-toolbar-actions {
  display: flex;
  gap: 10px;
  min-width: min(440px, 62%);
  align-items: center;
}

.ezsd-progress-track {
  flex: 1;
  height: 7px;
  overflow: hidden;
  background: #eaf1fa;
  border-radius: 999px;
}

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

.ezsd-flashcard {
  position: relative;
  display: block;
  width: 100%;
  min-height: 390px;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 21px;
  outline: none;
  perspective: 1200px;
  cursor: pointer;
}

.ezsd-flashcard:focus-visible {
  box-shadow: 0 0 0 4px rgba(20,121,255,.14);
}

.ezsd-card-side {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 26px 30px;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 21px;
  box-shadow: 0 12px 32px rgba(7,31,73,.07);
  backface-visibility: hidden;
  transition: transform .38s ease;
}

.ezsd-card-back {
  background: #f6faff;
  transform: rotateY(180deg);
}

.ezsd-flashcard.is-flipped .ezsd-card-front {
  transform: rotateY(180deg);
}

.ezsd-flashcard.is-flipped .ezsd-card-back {
  transform: rotateY(360deg);
}

.ezsd-card-content {
  display: flex;
  width: 100%;
  min-height: 100%;
  padding: 8px 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.ezsd-card-side small {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 5px 10px;
  color: #0b63d8;
  background: #eaf3ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ezsd-card-side strong {
  width: min(100%, 760px);
  max-width: 760px;
  margin: 0;
  color: var(--ezsd-navy);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ezsd-card-front strong {
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: -.015em;
}

.ezsd-card-back strong {
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.45;
  font-weight: 800;
}

.ezsd-card-side strong.is-long {
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.5;
}

.ezsd-card-side strong.is-very-long {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
}

.ezsd-card-side em {
  margin-top: 16px;
  color: #7a8799;
  font-size: 12px;
  font-style: normal;
}

.ezsd-card-explanation {
  display: block;
  width: min(100%, 700px);
  margin-top: 15px;
  color: #64738a;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-line;
}

.ezsd-card-source {
  display: inline-flex;
  margin-top: 15px;
  padding: 6px 10px;
  color: #0b63d8;
  background: #fff;
  border: 1px solid rgba(11,99,216,.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.ezsd-review-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
  animation: ezsd-review-in .16s ease both;
}

.ezsd-review-actions.is-saving {
  opacity: .65;
  pointer-events: none;
}

.ezsd-review-btn {
  display: flex;
  min-height: 56px;
  padding: 8px 10px;
  gap: 2px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.ezsd-review-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(7,31,73,.08);
}

.ezsd-review-btn span {
  font-size: 14px;
  font-weight: 900;
}

.ezsd-review-btn small {
  font-size: 10px;
  font-weight: 750;
  opacity: .72;
}

.ezsd-review-again { color: #b62f3a; background: #fff1f2; border-color: #ffd7da; }
.ezsd-review-hard  { color: #a45a0a; background: #fff7e9; border-color: #ffe2b7; }
.ezsd-review-good  { color: #0b63d8; background: #edf5ff; border-color: #d1e5ff; }
.ezsd-review-easy  { color: #167443; background: #edfaf3; border-color: #ccefdc; }

.ezsd-study-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  margin-top: 11px;
  align-items: center;
}

.ezsd-study-hint {
  color: #748198;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.ezsd-session-complete {
  min-height: 390px;
  padding: 42px 22px;
  text-align: center;
  background: #f6faff;
  border: 1px solid var(--ezsd-border);
  border-radius: 21px;
}

.ezsd-session-icon {
  display: flex;
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  align-items: center;
  justify-content: center;
  color: var(--ezsd-success);
  background: #e8f7ef;
  border-radius: 16px;
  font-size: 25px;
  font-weight: 900;
}

.ezsd-session-complete h2 {
  margin: 0;
  font-size: 26px;
}

.ezsd-session-complete > p {
  margin: 7px 0 19px;
  color: var(--ezsd-muted);
}

.ezsd-session-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  width: min(520px, 100%);
  margin: 0 auto 21px;
}

.ezsd-session-stats span {
  padding: 11px 7px;
  color: var(--ezsd-muted);
  background: #fff;
  border-radius: 12px;
  font-size: 11px;
}

.ezsd-session-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ezsd-navy);
  font-size: 20px;
}

@keyframes ezsd-review-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Card management */
.ezsd-manage-section {
  margin-top: 16px;
  padding: 21px;
}

.ezsd-card-editors {
  display: grid;
  gap: 9px;
}

.ezsd-card-editor {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 13px;
}

.ezsd-card-editor summary {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  align-items: center;
  cursor: pointer;
}

.ezsd-card-editor summary > span {
  display: flex;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  color: #0b63d8;
  background: #edf5ff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}

.ezsd-card-editor summary strong {
  line-height: 1.35;
}

.ezsd-editor-body {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: #f9fbfe;
  border-top: 1px solid var(--ezsd-border);
}

.ezsd-editor-body textarea {
  resize: vertical;
}

.ezsd-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ezsd-inline-message {
  color: var(--ezsd-muted);
  font-size: 12px;
}

.ezsd-job-status-static,
.ezsd-error-box {
  margin: 16px 0;
}

/* Plans and billing */
.ezsd-plans-section,
.ezsd-billing-section {
  margin-top: 16px;
}

.ezsd-page-heading {
  display: flex;
  gap: 22px;
  padding: 24px;
  align-items: flex-end;
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid var(--ezsd-border);
  border-radius: 20px;
  box-shadow: var(--ezsd-shadow-soft);
}

.ezsd-page-heading > div:first-child {
  max-width: 700px;
}

.ezsd-page-heading h1 {
  margin: 9px 0 6px;
  font-size: clamp(27px, 4vw, 39px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.ezsd-page-heading p {
  margin: 0;
  color: var(--ezsd-muted);
  font-size: 15px;
  line-height: 1.55;
}

.ezsd-current-plan-chip {
  min-width: 140px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 14px;
  text-align: right;
}

.ezsd-current-plan-chip span,
.ezsd-current-plan-chip strong {
  display: block;
}

.ezsd-current-plan-chip span {
  color: var(--ezsd-muted);
  font-size: 11px;
  font-weight: 700;
}

.ezsd-current-plan-chip strong {
  margin-top: 2px;
  font-size: 17px;
}

.ezsd-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.ezsd-plan-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 440px;
  padding: 20px;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 19px;
  box-shadow: var(--ezsd-shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ezsd-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 121, 255, .24);
  box-shadow: 0 16px 38px rgba(7, 31, 73, .09);
}

.ezsd-plan-card.is-featured {
  border-color: rgba(20, 121, 255, .42);
  box-shadow: 0 16px 40px rgba(20, 121, 255, .12);
}

.ezsd-plan-card.is-current {
  border-color: rgba(22, 134, 76, .34);
}

.ezsd-plan-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-plan-name {
  font-size: 20px;
  font-weight: 900;
}

.ezsd-plan-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 4px 8px;
  align-items: center;
  color: #0b63d8;
  background: #eaf3ff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ezsd-plan-badge.is-current {
  color: var(--ezsd-success);
  background: #e9f8ef;
}

.ezsd-price {
  display: flex;
  gap: 7px;
  margin: 19px 0 9px;
  align-items: flex-end;
}

.ezsd-price strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -.04em;
}

.ezsd-price span {
  padding-bottom: 3px;
  color: var(--ezsd-muted);
  font-size: 12px;
}

.ezsd-plan-subtitle {
  min-height: 44px;
  margin: 0;
  color: var(--ezsd-muted);
  font-size: 13px;
  line-height: 1.5;
}

.ezsd-plan-limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 17px 0;
}

.ezsd-plan-limits > div {
  min-width: 0;
  padding: 11px;
  background: #f6f9fd;
  border: 1px solid rgba(7, 31, 73, .06);
  border-radius: 12px;
}

.ezsd-plan-limits strong,
.ezsd-plan-limits span {
  display: block;
}

.ezsd-plan-limits strong {
  font-size: 19px;
  line-height: 1.1;
}

.ezsd-plan-limits span {
  margin-top: 3px;
  color: var(--ezsd-muted);
  font-size: 10px;
  line-height: 1.3;
}

.ezsd-plan-features {
  display: grid;
  gap: 9px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.ezsd-plan-features li {
  position: relative;
  padding-left: 21px;
  color: #435168;
  font-size: 13px;
  line-height: 1.42;
}

.ezsd-plan-features li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 1px;
  width: 11px;
  height: 7px;
  border-left: 2px solid #1479ff;
  border-bottom: 2px solid #1479ff;
  transform: rotate(-45deg);
}

.ezsd-plan-action {
  margin-top: auto;
}

.ezsd-plan-action > .ezsd-btn,
.ezsd-btn-current,
.ezsd-btn-disabled {
  width: 100%;
}

.ezsd-btn-current { color: var(--ezsd-success); background: #e9f8ef; }
.ezsd-btn-disabled { color: #8a94a5; background: #f0f2f5; }
.ezsd-paypal-button { min-height: 45px; overflow: hidden; border-radius: 10px; }
.ezsd-paypal-loading { display: flex; min-height: 45px; padding: 11px; align-items: center; justify-content: center; color: var(--ezsd-muted); background: #f6f8fb; border-radius: 10px; }
.ezsd-paypal-error { margin-top: 7px; padding: 9px; color: #9e252d; background: #fff0f1; border-radius: 9px; font-size: 12px; }

.ezsd-payment-note {
  display: flex;
  max-width: 760px;
  gap: 12px;
  margin: 15px auto 0;
  padding: 13px 15px;
  align-items: flex-start;
  color: var(--ezsd-muted);
  background: #f8faff;
  border: 1px solid var(--ezsd-border);
  border-radius: 14px;
}

.ezsd-payment-note-icon,
.ezsd-billing-empty-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: #1479ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5.1 3.4 9.7 8 11 4.6-1.3 8-5.9 8-11V5l-8-3Zm0 2.1 6 2.25V11c0 3.95-2.45 7.65-6 8.8-3.55-1.15-6-4.85-6-8.8V6.35L12 4.1Zm-1 4.4h2v5h-2v-5Zm0 6.5h2v2h-2v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5.1 3.4 9.7 8 11 4.6-1.3 8-5.9 8-11V5l-8-3Zm0 2.1 6 2.25V11c0 3.95-2.45 7.65-6 8.8-3.55-1.15-6-4.85-6-8.8V6.35L12 4.1Zm-1 4.4h2v5h-2v-5Zm0 6.5h2v2h-2v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ezsd-payment-note strong,
.ezsd-payment-note p {
  display: block;
  margin: 0;
}

.ezsd-payment-note strong {
  color: var(--ezsd-navy);
  font-size: 12px;
}

.ezsd-payment-note p {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
}

/* Billing */
.ezsd-subscription-card,
.ezsd-billing-empty,
.ezsd-invoices {
  margin-top: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 19px;
  box-shadow: var(--ezsd-shadow-soft);
}

.ezsd-billing-empty {
  display: flex;
  gap: 14px;
  align-items: center;
}

.ezsd-billing-empty > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.ezsd-billing-empty h2,
.ezsd-billing-empty p {
  margin: 0;
}

.ezsd-billing-empty h2 { font-size: 20px; }
.ezsd-billing-empty p { margin-top: 3px; color: var(--ezsd-muted); font-size: 13px; }

.ezsd-subscription-main {
  display: flex;
  gap: 13px;
  align-items: center;
}

.ezsd-subscription-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: #eaf3ff;
  border-radius: 13px;
  position: relative;
}

.ezsd-subscription-icon::before {
  content: "";
  position: absolute;
  inset: 11px;
  background: #1479ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm2 0v3h14V5H5Zm0 5v9h14v-9H5Zm2 3h6v2H7v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm2 0v3h14V5H5Zm0 5v9h14v-9H5Zm2 3h6v2H7v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ezsd-subscription-main > div:last-child {
  min-width: 0;
  flex: 1;
}

.ezsd-subscription-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ezsd-subscription-title-row h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.ezsd-subscription-main p {
  margin: 4px 0 0;
  color: var(--ezsd-muted);
  font-size: 13px;
}

.ezsd-subscription-status,
.ezsd-invoice-status {
  display: inline-flex;
  min-height: 23px;
  padding: 3px 8px;
  align-items: center;
  border-radius: 999px;
  color: #59677d;
  background: #eef1f5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.ezsd-subscription-status.status-active,
.ezsd-invoice-status.status-paid { color: var(--ezsd-success); background: #e9f8ef; }
.ezsd-subscription-status.status-cancelled,
.ezsd-subscription-status.status-suspended { color: var(--ezsd-warning); background: #fff4df; }
.ezsd-invoice-status.status-refunded,
.ezsd-invoice-status.status-reversed { color: var(--ezsd-danger); background: #fff0f1; }

.ezsd-cancelled-note {
  display: inline-flex;
  margin-top: 9px;
  padding: 7px 9px;
  color: #8b5712;
  background: #fff6e5;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.4;
}

.ezsd-subscription-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.ezsd-subscription-details > div {
  min-width: 0;
  padding: 12px;
  background: #f6f9fd;
  border-radius: 12px;
}

.ezsd-subscription-details span,
.ezsd-subscription-details strong {
  display: block;
}

.ezsd-subscription-details span {
  color: var(--ezsd-muted);
  font-size: 10px;
  font-weight: 700;
}

.ezsd-subscription-details strong {
  margin-top: 3px;
  font-size: 13px;
}

.ezsd-subscription-actions {
  display: flex;
  gap: 9px;
  margin-top: 17px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ezsd-invoices-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.ezsd-invoices-head h2 {
  margin: 7px 0 0;
  font-size: 21px;
}

.ezsd-invoices-head > span {
  color: var(--ezsd-muted);
  font-size: 12px;
}

.ezsd-invoice-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.ezsd-invoice-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 11px;
  padding: 12px;
  align-items: center;
  background: #fbfcfe;
  border: 1px solid rgba(7, 31, 73, .07);
  border-radius: 12px;
}

.ezsd-invoice-row-icon {
  width: 38px;
  height: 38px;
  background: #edf5ff;
  border-radius: 11px;
  position: relative;
}

.ezsd-invoice-row-icon::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: #1479ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l3 3v17H6V2Zm2 2v16h8V6h-2V4H8Zm2 5h4v2h-4V9Zm0 4h4v2h-4v-2Zm0 4h3v2h-3v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l3 3v17H6V2Zm2 2v16h8V6h-2V4H8Zm2 5h4v2h-4V9Zm0 4h4v2h-4v-2Zm0 4h3v2h-3v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ezsd-invoice-row-main,
.ezsd-invoice-row-amount {
  min-width: 0;
}

.ezsd-invoice-row-main strong,
.ezsd-invoice-row-main span,
.ezsd-invoice-row-amount strong {
  display: block;
}

.ezsd-invoice-row-main strong { font-size: 13px; }
.ezsd-invoice-row-main span { margin-top: 2px; color: var(--ezsd-muted); font-size: 11px; }
.ezsd-invoice-row-amount { text-align: right; }
.ezsd-invoice-row-amount strong { margin-bottom: 4px; font-size: 13px; }

.ezsd-invoice-view {
  color: #0b63d8;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ezsd-invoice-empty {
  margin-top: 14px;
}

.ezsd-invoice {
  margin-top: 17px;
  padding: 22px;
}

.ezsd-billing-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 19px;
  align-items: center;
}

.ezsd-billing-card h2 {
  margin: 4px 0;
}

.ezsd-billing-card p {
  margin: 0;
  color: var(--ezsd-muted);
}

.ezsd-billing-meta {
  display: flex;
  gap: 9px;
}

.ezsd-billing-meta span {
  display: block;
  min-width: 120px;
  padding: 11px;
  color: var(--ezsd-muted);
  background: #f5f8fc;
  border-radius: 11px;
  font-size: 11px;
}

.ezsd-billing-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--ezsd-navy);
  font-size: 13px;
}

.ezsd-invoices h2 {
  margin-top: 0;
}

.ezsd-table-wrap {
  overflow-x: auto;
}

.ezsd-table-wrap table,
.ezsd-invoice table {
  width: 100%;
  border-collapse: collapse;
}

.ezsd-table-wrap th,
.ezsd-table-wrap td,
.ezsd-invoice th,
.ezsd-invoice td {
  padding: 12px;
  border-bottom: 1px solid var(--ezsd-border);
  text-align: left;
  white-space: nowrap;
}

.ezsd-table-wrap th {
  color: var(--ezsd-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.ezsd-table-wrap a {
  color: #0b63d8;
  font-weight: 800;
}

.ezsd-invoice {
  max-width: 860px;
  margin: 17px auto;
}

.ezsd-invoice-head {
  display: flex;
  gap: 21px;
  padding-bottom: 21px;
  justify-content: space-between;
  border-bottom: 2px solid var(--ezsd-navy);
}

.ezsd-invoice-head > div:last-child {
  text-align: right;
}

.ezsd-invoice-head span,
.ezsd-invoice-to span {
  display: block;
  color: var(--ezsd-muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ezsd-invoice-brand {
  font-size: 28px;
}

.ezsd-invoice-head p,
.ezsd-invoice-to p {
  margin: 4px 0;
  color: var(--ezsd-muted);
}

.ezsd-invoice-to {
  padding: 21px 0;
}

.ezsd-invoice-to strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.ezsd-invoice tfoot th {
  border-bottom: 0;
  font-size: 17px;
}

.ezsd-invoice-foot {
  margin-top: 21px;
  padding: 14px;
  color: var(--ezsd-muted);
  background: #f5f8fc;
  border-radius: 12px;
}

.ezsd-invoice-foot p {
  margin: 4px 0;
}

.ezsd-print-actions {
  display: flex;
  gap: 9px;
  margin: 16px;
  justify-content: center;
}

/* Tablet */
@media (max-width: 960px) {
  .ezsd-form-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .ezsd-field-wide,
  .ezsd-field-wide-tablet {
    grid-column: 1 / -1;
  }

  .ezsd-deck-grid {
    grid-template-columns: 1fr;
  }

  .ezsd-plan-grid {
    grid-template-columns: 1fr;
  }

  .ezsd-plan-card {
    min-height: auto;
  }

  .ezsd-billing-card {
    grid-template-columns: 1fr;
  }

  .ezsd-billing-meta {
    flex-wrap: wrap;
  }
}

/* Mobile */
@media (max-width: 680px) {
  .ezsd-shell {
    width: min(100% - 16px, 1120px);
    margin-top: 10px;
    margin-bottom: 42px;
  }

  .ezsd-app-nav {
    width: 100%;
    margin-bottom: 11px;
  }

  .ezsd-app-nav a {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .ezsd-hero,
  .ezsd-create-section,
  .ezsd-decks-section,
  .ezsd-deck-header,
  .ezsd-study-panel,
  .ezsd-manage-section,
  .ezsd-notice-card,
  .ezsd-plans-head,
  .ezsd-plan-card,
  .ezsd-billing-card,
  .ezsd-invoices,
  .ezsd-invoice {
    border-radius: 17px;
  }

  .ezsd-hero {
    padding: 19px;
    align-items: stretch;
    flex-direction: column;
  }

  .ezsd-hero h1,
  .ezsd-deck-header h1,
  .ezsd-plans-head h1,
  .ezsd-billing-section h1 {
    font-size: 29px;
  }

  .ezsd-hero p,
  .ezsd-deck-header p {
    font-size: 14px;
  }

  .ezsd-usage {
    display: grid;
    width: 100%;
    padding: 13px 14px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    text-align: left;
    flex: auto;
  }

  .ezsd-usage strong {
    margin: 0;
    font-size: 29px;
  }

  .ezsd-usage small {
    text-align: right;
  }

  .ezsd-create-section,
  .ezsd-decks-section,
  .ezsd-manage-section {
    padding: 16px;
  }

  .ezsd-panel-head h2,
  .ezsd-section-head h2 {
    font-size: 21px;
  }

  .ezsd-dropzone {
    min-height: 118px;
    padding: 16px;
  }

  .ezsd-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ezsd-field-wide,
  .ezsd-field-wide-tablet {
    grid-column: auto;
  }

  .ezsd-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ezsd-generate-btn {
    width: 100%;
  }

  .ezsd-deck-card {
    grid-template-columns: 42px minmax(0,1fr);
  }

  .ezsd-deck-actions {
    grid-column: 1 / -1;
  }

  .ezsd-deck-actions .ezsd-btn {
    flex: 1;
  }

  .ezsd-deck-header {
    padding: 18px;
  }

  .ezsd-study-panel {
    padding: 12px;
  }

  .ezsd-study-toolbar {
    gap: 8px;
    align-items: flex-start;
  }

  .ezsd-study-toolbar-actions {
    min-width: 0;
    flex: 1;
  }

  .ezsd-progress-track {
    display: none;
  }

  .ezsd-flashcard {
    min-height: 410px;
  }

  .ezsd-card-side {
    padding: 20px 16px;
  }

  .ezsd-card-front strong {
    font-size: 20px;
  }

  .ezsd-card-back strong {
    font-size: 19px;
  }

  .ezsd-card-side strong.is-long {
    font-size: 16px;
  }

  .ezsd-card-side strong.is-very-long {
    font-size: 14px;
  }

  .ezsd-card-explanation {
    font-size: 12px;
  }

  .ezsd-review-actions {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
  }

  .ezsd-review-btn {
    min-height: 52px;
  }

  .ezsd-study-actions {
    grid-template-columns: 1fr 1fr;
  }

  .ezsd-study-hint {
    grid-column: 1 / -1;
    grid-row: 1;
  }

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

  .ezsd-billing-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ezsd-billing-meta span {
    min-width: 0;
  }

  .ezsd-invoice-head {
    flex-direction: column;
  }

  .ezsd-invoice-head > div:last-child {
    text-align: left;
  }

  .ezsd-print-actions {
    flex-direction: column;
  }

  .ezsd-print-actions .ezsd-btn {
    width: 100%;
  }
}


/* Plans and billing responsive */
@media (max-width: 960px) {
  .ezsd-plan-grid { grid-template-columns: 1fr; }
  .ezsd-plan-card { min-height: auto; }
}

@media (max-width: 680px) {
  .ezsd-page-heading {
    gap: 14px;
    padding: 17px;
    align-items: stretch;
    flex-direction: column;
    border-radius: 16px;
  }

  .ezsd-page-heading h1 { font-size: 26px; }
  .ezsd-page-heading p { font-size: 13px; }

  .ezsd-current-plan-chip {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    text-align: left;
  }

  .ezsd-plan-grid { gap: 10px; margin-top: 10px; }
  .ezsd-plan-card { padding: 16px; border-radius: 16px; }
  .ezsd-price { margin-top: 15px; }
  .ezsd-price strong { font-size: 33px; }
  .ezsd-plan-subtitle { min-height: 0; }
  .ezsd-plan-limits { margin: 14px 0; }
  .ezsd-plan-limits > div { padding: 10px; }
  .ezsd-payment-note { margin-top: 10px; padding: 11px; }

  .ezsd-billing-empty,
  .ezsd-subscription-card,
  .ezsd-invoices {
    margin-top: 10px;
    padding: 15px;
    border-radius: 16px;
  }

  .ezsd-billing-empty {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ezsd-billing-empty .ezsd-btn { width: 100%; }
  .ezsd-subscription-title-row h2 { font-size: 20px; }
  .ezsd-subscription-details { grid-template-columns: 1fr; gap: 7px; }
  .ezsd-subscription-actions { justify-content: stretch; }
  .ezsd-subscription-actions .ezsd-btn { width: 100%; }

  .ezsd-invoice-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px;
  }

  .ezsd-invoice-row-icon { width: 34px; height: 34px; }
  .ezsd-invoice-row-amount { grid-column: 2 / 3; text-align: left; }
  .ezsd-invoice-row-amount strong,
  .ezsd-invoice-status { display: inline-flex; vertical-align: middle; }
  .ezsd-invoice-row-amount strong { margin: 0 7px 0 0; }
  .ezsd-invoice-view { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
}

@media print {
  body * { visibility: hidden !important; }
  .ezsd-invoice,
  .ezsd-invoice * { visibility: visible !important; }
  .ezsd-invoice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
  .ezsd-app-nav,
  .ezsd-print-actions,
  header,
  footer,
  #wpadminbar { display: none !important; }
}

/* =========================================================
   Study Decks v2.3 — plan quality + simplified subscription
   ========================================================= */
.ezsd-quality-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 14px;
  padding: 7px 10px;
  align-items: center;
  gap: 7px;
  color: #174f9e;
  background: #eef5ff;
  border: 1px solid #dceaff;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.ezsd-quality-pill > span {
  display: block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(23, 79, 158, .09);
}

.ezsd-quality-pill.quality-pro {
  color: #6f45c7;
  background: #f5f0ff;
  border-color: #e8dcff;
}

.ezsd-plan-change-copy {
  min-height: 17px;
  margin-bottom: 8px;
  color: var(--ezsd-muted);
  font-size: 11px;
  text-align: center;
}

.ezsd-payment-email-card {
  display: flex;
  margin-top: 14px;
  padding: 18px;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #f5f9ff 0%, #fff 100%);
  border: 1px solid var(--ezsd-border);
  border-radius: 18px;
  box-shadow: var(--ezsd-shadow-soft);
}

.ezsd-payment-email-icon {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: #e8f2ff;
  border-radius: 13px;
}

.ezsd-payment-email-icon::before {
  content: "";
  position: absolute;
  inset: 12px 9px;
  border: 2px solid var(--ezsd-blue);
  border-radius: 4px;
}

.ezsd-payment-email-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 13px;
  width: 16px;
  height: 10px;
  border-left: 2px solid var(--ezsd-blue);
  border-bottom: 2px solid var(--ezsd-blue);
  transform: rotate(-45deg) skew(8deg, 8deg);
}

.ezsd-payment-email-card h2,
.ezsd-payment-email-card p {
  margin: 0;
}

.ezsd-payment-email-card h2 {
  margin-top: 3px;
  color: var(--ezsd-navy);
  font-size: 18px;
}

.ezsd-payment-email-card p {
  margin-top: 5px;
  color: var(--ezsd-muted);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 680px) {
  .ezsd-quality-pill {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .ezsd-plan-change-copy {
    margin-top: 2px;
  }

  .ezsd-payment-email-card {
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
  }

  .ezsd-payment-email-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .ezsd-payment-email-card h2 {
    font-size: 16px;
  }
}


/* =========================================================
   v3.0 — Smart Review experience
   ========================================================= */
.ezsd-due-inline { color: #1479ff; font-weight: 800; }
.ezsd-due-inline.is-clear { color: #1b8b55; }

.ezsd-deck-page {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.ezsd-review-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 4px 0 16px;
  padding: 0 4px;
}

.ezsd-review-back {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  color: #102443;
  background: transparent;
  border-radius: 12px;
  text-decoration: none !important;
  font-size: 23px;
  line-height: 1;
}

.ezsd-review-back:hover { background: #eef4fd; }

.ezsd-review-title { min-width: 0; }
.ezsd-review-title h1 {
  margin: 0;
  color: #102443;
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.2;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.ezsd-review-title p {
  margin: 4px 0 0;
  color: #74839a;
  font-size: 12px;
}
.ezsd-header-due { font-weight: 750; }

.ezsd-study-panel.ezsd-study-panel-v3 {
  padding: 0;
  background: #edf3fb;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ezsd-study-panel-v3 .ezsd-study-toolbar {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 20px;
  align-items: center;
  margin: 0 0 18px;
  padding: 0 4px;
}

.ezsd-study-panel-v3 .ezsd-study-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #172b4a;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.ezsd-study-panel-v3 .ezsd-progress-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: #d5dfed;
  border-radius: 999px;
}

.ezsd-study-panel-v3 .ezsd-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #2f6fe4;
  border-radius: inherit;
  transition: width .25s ease;
}

.ezsd-flashcard.ezsd-flashcard-v3 {
  position: relative;
  display: block;
  width: 100%;
  min-height: 430px;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 24px;
  outline: none;
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ezsd-flashcard-v3:focus-visible {
  box-shadow: 0 0 0 4px rgba(47,111,228,.16);
}

.ezsd-flashcard-v3 .ezsd-card-side {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 58px 42px 54px;
  align-items: center;
  justify-content: center;
  overflow: auto;
  text-align: center;
  background: #ffffff;
  border: 1px solid #d4dfed;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(16,36,67,.07);
  backface-visibility: hidden;
  transition: transform .34s ease;
}

.ezsd-flashcard-v3 .ezsd-card-back {
  transform: rotateY(180deg);
}
.ezsd-flashcard-v3.is-flipped .ezsd-card-front { transform: rotateY(180deg); }
.ezsd-flashcard-v3.is-flipped .ezsd-card-back { transform: rotateY(360deg); }

.ezsd-flashcard-v3 .ezsd-card-content {
  display: flex;
  width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.ezsd-card-corner-badge {
  position: absolute;
  top: 18px;
  left: 20px;
  display: inline-flex;
  min-height: 36px;
  padding: 8px 11px;
  align-items: center;
  justify-content: center;
  color: #2867dc;
  background: #edf4ff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.ezsd-answer-badge {
  color: #159448;
  background: #eaf7ee;
}

.ezsd-card-side-label {
  position: absolute;
  top: 24px;
  right: 22px;
  color: #8390a5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.ezsd-flashcard-v3 .ezsd-card-side strong {
  width: min(100%, 690px);
  max-width: 690px;
  margin: 0;
  color: #102443;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ezsd-flashcard-v3 .ezsd-card-front strong {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -.02em;
}

.ezsd-flashcard-v3 .ezsd-card-back strong {
  font-size: clamp(23px, 2.8vw, 30px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -.015em;
}

.ezsd-flashcard-v3 .ezsd-card-side strong.is-long {
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.4;
}
.ezsd-flashcard-v3 .ezsd-card-side strong.is-very-long {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
}

.ezsd-flashcard-v3 .ezsd-card-explanation {
  display: block;
  width: min(100%, 610px);
  margin-top: 15px;
  color: #52637c;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.ezsd-flashcard-v3 .ezsd-card-source {
  display: inline-flex;
  margin-top: 16px;
  padding: 7px 11px;
  color: #2465d8;
  background: #f5f9ff;
  border: 1px solid #d8e6fb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.ezsd-card-tap-hint {
  position: absolute;
  bottom: 19px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 36px);
  transform: translateX(-50%);
  color: #8390a5;
  font-size: 11px;
  font-weight: 700;
}

.ezsd-review-actions.ezsd-review-actions-v3 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  animation: ezsd-review-in .16s ease both;
}

.ezsd-review-actions-v3[hidden] { display: none !important; }
.ezsd-review-actions-v3.is-saving { opacity: .62; pointer-events: none; }

.ezsd-review-actions-v3 .ezsd-review-btn {
  display: flex;
  min-height: 76px;
  padding: 10px 8px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(16,36,67,.08);
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}

.ezsd-review-actions-v3 .ezsd-review-btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.ezsd-review-actions-v3 .ezsd-review-btn span { font-size: 14px; font-weight: 900; }
.ezsd-review-actions-v3 .ezsd-review-btn small { color: inherit; font-size: 10px; font-weight: 800; opacity: .95; }
.ezsd-review-actions-v3 .ezsd-review-again { background: #ef242b; }
.ezsd-review-actions-v3 .ezsd-review-hard  { background: #ef7e00; }
.ezsd-review-actions-v3 .ezsd-review-good  { background: #13a956; }
.ezsd-review-actions-v3 .ezsd-review-easy  { background: #3265da; }

.ezsd-study-panel-v3 .ezsd-session-complete {
  min-height: 430px;
  padding: 42px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: #fff;
  border: 1px solid #d4dfed;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(16,36,67,.06);
}
.ezsd-study-panel-v3 .ezsd-session-complete[hidden] { display: none !important; }
.ezsd-study-panel-v3 .ezsd-session-complete h2 { margin: 0; color: #102443; font-size: 26px; }
.ezsd-study-panel-v3 .ezsd-session-complete > p { max-width: 560px; margin: 8px 0 20px; color: #6e7d94; }
.ezsd-study-panel-v3 .ezsd-session-stats { margin-bottom: 22px; }

@media (max-width: 767px) {
  .ezsd-review-header { margin-bottom: 13px; }
  .ezsd-review-title h1 { font-size: 18px; }
  .ezsd-review-title p { font-size: 11px; }

  .ezsd-study-panel-v3 .ezsd-study-toolbar {
    grid-template-columns: auto minmax(80px, 1fr);
    gap: 14px;
    margin-bottom: 13px;
  }

  .ezsd-flashcard.ezsd-flashcard-v3 { min-height: 410px; }
  .ezsd-flashcard-v3 .ezsd-card-side {
    padding: 58px 18px 50px;
    border-radius: 20px;
  }
  .ezsd-card-corner-badge { top: 16px; left: 16px; min-height: 32px; padding: 7px 9px; font-size: 9px; }
  .ezsd-card-side-label { top: 21px; right: 16px; font-size: 9px; }
  .ezsd-flashcard-v3 .ezsd-card-front strong { font-size: clamp(21px, 6.5vw, 27px); }
  .ezsd-flashcard-v3 .ezsd-card-back strong { font-size: clamp(20px, 6vw, 25px); }
  .ezsd-flashcard-v3 .ezsd-card-side strong.is-long { font-size: clamp(17px, 5.4vw, 21px); }
  .ezsd-flashcard-v3 .ezsd-card-side strong.is-very-long { font-size: clamp(15px, 4.8vw, 18px); }
  .ezsd-flashcard-v3 .ezsd-card-explanation { font-size: 12px; line-height: 1.5; }
  .ezsd-card-tap-hint { bottom: 17px; font-size: 10px; }

  .ezsd-review-actions.ezsd-review-actions-v3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
  }
  .ezsd-review-actions-v3 .ezsd-review-btn { min-height: 62px; border-radius: 12px; }
}

@media (max-width: 420px) {
  .ezsd-flashcard.ezsd-flashcard-v3 { min-height: 390px; }
  .ezsd-review-actions.ezsd-review-actions-v3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* =========================================================
   v3.0.2 — review header + progress cleanup
   ========================================================= */
.ezsd-review-header {
  width: min(100%, 960px);
  margin: 6px auto 14px;
  padding: 0 4px;
}

.ezsd-review-title {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.ezsd-review-title h1 {
  flex: 1 1 auto;
  min-width: 0;
}

.ezsd-review-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #74839a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ezsd-review-meta-separator {
  color: #bcc6d4;
}

.ezsd-header-due {
  color: #2f6fe4;
  font-weight: 850;
}

.ezsd-header-due.is-clear {
  color: #168653;
}

.ezsd-study-panel.ezsd-study-panel-v3 {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 0;
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

.ezsd-study-panel-v3 .ezsd-study-toolbar {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr);
  gap: 16px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0 4px;
  align-items: center;
  background: transparent;
}

.ezsd-study-panel-v3 .ezsd-progress-track {
  height: 4px;
  background: #e3eaf4;
}

.ezsd-study-panel-v3 .ezsd-study-counter {
  min-width: 48px;
  font-size: 13px;
}

.ezsd-flashcard.ezsd-flashcard-v3 {
  width: 100%;
}

@media (max-width: 767px) {
  .ezsd-review-header {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .ezsd-review-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .ezsd-review-meta {
    gap: 6px;
    font-size: 11px;
  }

  .ezsd-study-panel-v3 .ezsd-study-toolbar {
    grid-template-columns: auto minmax(80px, 1fr);
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 2px;
  }
}


/* =========================================================
   v3.0.3 — flashcard corner artifact fix
   Prevent 3D flip layers from peeking outside rounded corners.
   ========================================================= */
.ezsd-flashcard.ezsd-flashcard-v3 {
  overflow: hidden !important;
  border-radius: 24px !important;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.ezsd-flashcard-v3 .ezsd-card-side {
  overflow: hidden !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  background-clip: padding-box;
}

.ezsd-flashcard-v3 .ezsd-card-front,
.ezsd-flashcard-v3 .ezsd-card-back {
  border-radius: 24px !important;
}

@media (max-width: 767px) {
  .ezsd-flashcard.ezsd-flashcard-v3,
  .ezsd-flashcard-v3 .ezsd-card-front,
  .ezsd-flashcard-v3 .ezsd-card-back {
    border-radius: 20px !important;
  }
}

/* =========================================================
   v3.1 Commercial plans + partner access
   ========================================================= */
.ezsd-billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 16px 0 2px;
  padding: 4px;
  background: #eef4fb;
  border: 1px solid #dce6f3;
  border-radius: 14px;
}
.ezsd-billing-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #60708b;
  border-radius: 10px;
  min-height: 38px;
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.ezsd-billing-toggle button.is-active {
  background: #fff;
  color: var(--ezsd-navy);
  box-shadow: 0 4px 14px rgba(7,31,73,.08);
}
.ezsd-billing-toggle button span {
  margin-left: 5px;
  color: #0c8b4c;
  font-size: 10px;
  font-weight: 900;
}
.ezsd-price-cycle small {
  display: block;
  margin-top: 4px;
  color: #0c8b4c;
  font-size: 11px;
  font-weight: 800;
}
.ezsd-current-plan-chip small {
  display: block;
  margin-top: 3px;
  color: var(--ezsd-muted);
  font-size: 10px;
}
.ezsd-payment-cycle-panel[hidden],
.ezsd-price-cycle[hidden] {
  display: none !important;
}
.ezsd-partner-access-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ezsd-border);
  border-radius: 18px;
  box-shadow: var(--ezsd-shadow-soft);
}
.ezsd-partner-access-card h3 {
  margin: 8px 0 5px;
  color: var(--ezsd-navy);
  font-size: 19px;
}
.ezsd-partner-access-card p {
  margin: 0;
  color: var(--ezsd-muted);
  font-size: 13px;
  line-height: 1.5;
}
.ezsd-partner-access-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.ezsd-partner-access-form input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ezsd-navy);
  background: #f9fbfe;
  border: 1px solid var(--ezsd-border-strong);
  border-radius: 11px;
  outline: none;
  text-transform: uppercase;
}
.ezsd-partner-access-form input:focus {
  border-color: #4a91ff;
  box-shadow: 0 0 0 3px rgba(20,121,255,.10);
}
.ezsd-partner-message {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--ezsd-muted);
  font-size: 11px;
}
.ezsd-partner-message.is-success { color: #0c8b4c; }
.ezsd-partner-message.is-error { color: #b8323b; }

@media (max-width: 767px) {
  .ezsd-billing-toggle {
    display: flex;
    width: 100%;
  }
  .ezsd-billing-toggle button {
    flex: 1 1 0;
  }
  .ezsd-billing-toggle button span {
    display: block;
    margin: 1px 0 0;
  }
  .ezsd-partner-access-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .ezsd-partner-access-form {
    grid-template-columns: 1fr;
  }
  .ezsd-partner-access-form .ezsd-btn {
    width: 100%;
  }
}
.ezsd-usage .ezsd-partner-provider { margin-top: 7px; color: #0b63d8; font-weight: 800; }

/* Platform organization mode — private student navigation */
.ezsd-platform-shell .ezsd-app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ezsd-platform-brand {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  margin-left: auto;
  color: #60708a;
  background: #f5f8fc;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 640px) {
  .ezsd-platform-brand {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
