.sdialog-state {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.sdialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: default;
}
body:has(#sdialog-open:checked) .sdialog-overlay { display: block; }
html:has(#sdialog-open:checked),
body:has(#sdialog-open:checked),
html.sdialog-open,
body.sdialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body:has(#sdialog-open:checked) .v2-header { z-index: 0; }
.sdialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2147483646;
  width: calc(100% - 2rem);
  max-width: min(1020px, calc(100% - 2rem));
  height: min(640px, 90dvh);
  max-height: 90dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #6b7280;
}
.sdialog *,
.sdialog *::before,
.sdialog *::after { box-sizing: border-box; }
body:has(#sdialog-open:checked) .sdialog {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.sdialog-sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 220px;
  width: 220px;
  min-width: 220px;
  margin: 0;
  padding: 0 12px 16px;
  border-right: 1px solid #e9e9ea;
  background: #f4f4f5;
  overflow: auto;
  color: #6b7280;
}
.sdialog-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  margin: 0 0 10px;
  padding: 20px 10px 16px;
}
h2.sdialog-sidebar-title,
.sdialog-sidebar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #6b7280;
}
.sdialog-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sdialog-tab {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.sdialog-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font: 500 14px/1.3 Inter, "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
}
.sdialog-nav-item:hover { background: #f4f4f4; color: #6b7280; }
.sdialog-nav-label { display: inline; }
.sdialog-nav-label--short { display: none; }
body:has(#sdialog-tab-profile:checked) .sdialog-nav-item[for="sdialog-tab-profile"],
body:has(#sdialog-tab-billing:checked) .sdialog-nav-item[for="sdialog-tab-billing"] {
  background: #eaf1ff;
  color: #0078ff;
}
.sdialog-nav-icon {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}
.sdialog-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #fff;
  overflow: hidden;
}
.sdialog-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 20px 28px 16px;
  border-bottom: 1px solid #e9e9ea;
}
.sdialog-main-title {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #6b7280;
}
.sdialog-main-title-profile,
.sdialog-main-title-billing { display: none; }
body:has(#sdialog-tab-profile:checked) .sdialog-main-title-profile,
body:has(#sdialog-tab-billing:checked) .sdialog-main-title-billing {
  display: block;
}
.sdialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
}
.sdialog-close:hover { background: #f4f4f4; }
.sdialog-close--mobile { display: none; }
.sdialog-close-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.sdialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 28px 28px;
  overflow: auto;
}
.sdialog-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.sdialog-panel--billing { gap: 14px; }
body:has(#sdialog-tab-profile:checked) .sdialog-panel--profile,
body:has(#sdialog-tab-billing:checked) .sdialog-panel--billing {
  display: flex;
}
.sdialog-profile-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid #e9e9ea;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 56%);
}
.sdialog-profile-heading {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #6b7280;
}
.sdialog-profile-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}
.sdialog-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sdialog-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #eaf1ff;
  box-shadow: 0 0 0 1px #e5e7eb, 0 8px 20px -10px rgba(15, 23, 42, 0.28);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0078ff;
}
.sdialog-avatar-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sdialog-avatar.has-photo .sdialog-avatar-img { display: block; }
.sdialog-avatar.has-photo .sdialog-avatar-fallback { display: none; }
.sdialog-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sdialog-avatar-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
}
.sdialog-avatar-email {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sdialog-photo-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0078ff;
  cursor: pointer;
  overflow: hidden;
}
.sdialog-photo-btn input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.sdialog-photo-btn:hover { text-decoration: underline; }
.profile-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.profile-page .sdialog-profile-heading {
  font-size: 22px;
  color: #111827;
}
.sdialog-profile-card {
  padding: 22px;
  border: 1px solid #e9e9ea;
  border-radius: 14px;
  background: #fff;
}
.sdialog-profile-card-title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}
.sdialog-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
}
.sdialog-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}
.sdialog-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #e9e9ea;
  border-radius: 10px;
  background: #fff;
  font: 400 16px/1.4 Inter, "Segoe UI", sans-serif;
  color: #6b7280;
  outline: none;
}
.sdialog-input:focus {
  border-color: #7284FF;
  box-shadow: 0 0 0 3px rgba(114, 132, 255, 0.15);
}
.sdialog-input[readonly] {
  background: #f4f4f5;
  cursor: not-allowed;
}
.sdialog-field-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}
.sdialog-profile-status {
  min-height: 1.2em;
  margin: 0 0 8px;
  font-size: 13px;
  color: #047857;
}
.sdialog-profile-status.is-error { color: #b91c1c; }
.sdialog-profile-actions {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #f3f4f6;
}
.sdialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #e9e9ea;
  border-radius: 8px;
  background: #fff;
  font: 600 13px/1 Inter, "Segoe UI", sans-serif;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.sdialog-btn--primary {
  border-color: transparent;
  background: linear-gradient(90deg, #3b82f6 0%, #6d8bff 100%);
  color: #fff;
}
.sdialog-btn--primary:hover {
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.55);
  color: #fff;
}
.sdialog-btn:disabled { opacity: 0.6; cursor: wait; }
a.sdialog-btn { text-decoration: none; }
.sdialog-btn--upgrade {
  border-color: transparent;
  background: linear-gradient(90deg, #3b82f6 0%, #6d8bff 100%);
  color: #fff;
}
.sdialog-btn--upgrade:hover {
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.55);
  color: #fff;
}
.sdialog-btn--cancel {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.sdialog-btn--cancel:hover {
  background: #f9fafb;
  color: #111827;
}
.sdialog-btn--cancel:disabled {
  opacity: 0.65;
  cursor: default;
}
.sdialog-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 20px 22px;
  border: 1px solid #e9e9ea;
  border-radius: 12px;
  background: #fff;
}
.sdialog-card-copy { min-width: 0; }
.sdialog-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}
.sdialog-metric {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #6b7280;
}
.sdialog-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}
.sdialog-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
}
.sdialog-card-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}
.sdialog-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.sdialog-plan--paid { display: none; flex-direction: column; align-items: stretch; gap: 14px; }
body:has(#sdialog-plan-paid:checked) .sdialog-plan--free { display: none; }
body:has(#sdialog-plan-paid:checked) .sdialog-plan--paid { display: flex; }
.sdialog-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.sdialog-plan-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sdialog-plan-title-row .sdialog-metric { display: inline; margin: 0; }
.sdialog-plan-price {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
}
.sdialog-plan-price-unit {
  font-size: 13px;
  font-weight: 500;
}
.sdialog-plan-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
}
.sdialog-plan-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e9e9ea;
  border-radius: 10px;
  background: #f4f4f5;
}
.sdialog-plan-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.sdialog-plan-meta-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  margin: 0 4px;
  background: #e9e9ea;
}
.sdialog-plan-meta-label { font-weight: 400; }
.sdialog-plan-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}
label.v2-item { cursor: pointer; }

@media (max-width: 719px) and (orientation: portrait) {
  .sdialog {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    height: auto;
    max-height: min(90dvh, calc(100dvh - 24px));
    border-radius: 16px;
    flex-direction: column;
  }
  body:has(#sdialog-open:checked) .sdialog { flex-direction: column; }
  .sdialog-sidebar {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    border-right: 0;
    border-bottom: 1px solid #e9e9ea;
    padding: 16px;
    background: #fff;
    overflow: visible;
  }
  .sdialog-sidebar-head {
    margin: 0 0 12px;
    padding: 0;
    min-height: 32px;
  }
  .sdialog-sidebar-title { font-size: 17px; }
  .sdialog-close--mobile { display: flex; width: 30px; height: 30px; }
  .sdialog-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e9e9ea;
    border-radius: 12px;
    background: #f4f4f5;
  }
  .sdialog-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
  }
  .sdialog-nav-label--full { display: none; }
  .sdialog-nav-label--short { display: block; }
  .sdialog-plan {
    flex-direction: column;
    align-items: stretch;
  }
  .sdialog-plan-top {
    flex-direction: row;
    align-items: flex-start;
  }
  .sdialog-plan-meta-sep { display: none; }
  .sdialog-plan--free .sdialog-btn { width: 100%; height: 44px; }
  .sdialog-plan--paid .sdialog-btn--cancel {
    width: auto;
    height: 36px;
  }
  .sdialog-main-header { display: none; }
  .sdialog-body { padding: 16px; }
  .sdialog-profile-hero,
  .sdialog-profile-card {
    padding: 18px 16px;
    border-radius: 12px;
  }
  .sdialog-avatar { width: 64px; height: 64px; font-size: 16px; }
  .sdialog-btn {
    width: 100%;
    height: 44px;
    font-size: 14px;
  }
}

.cdialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: Inter, "Segoe UI", sans-serif;
}
.cdialog[hidden] { display: none !important; }
.cdialog.is-open:not([hidden]) { display: flex !important; }
.cdialog-error {
  margin: 10px 0 0;
  font-size: 13px;
  color: #b91c1c;
}
.cdialog-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: default;
}
.cdialog-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.28);
  color: #6b7280;
}
@media (orientation: landscape) and (max-height: 500px) {
  .sdialog {
    width: calc(100% - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: none;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
  }
}
.cdialog-head {
  position: relative;
  padding: 22px 24px 14px;
}
.cdialog-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 0 12px;
  color: #6b7280;
}
.cdialog-x {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}
.cdialog-x svg { width: 18px; height: 18px; }
.cdialog-x:hover { background: #f4f4f5; color: #6b7280; }
.cdialog-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #6b7280;
}
.cdialog-body {
  padding: 18px 24px 16px;
  background: #f7f7f8;
}
.cdialog-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #6b7280;
}
.cdialog-until {
  margin: 10px 0 0;
  font-size: 13px;
  color: #9ca3af;
}
.cdialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #fff;
}
.cdialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 5px;
  font: 600 14px/1 Inter, "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.cdialog-btn:disabled { opacity: 0.6; cursor: wait; }
.cdialog-btn--ghost {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
}
.cdialog-btn--ghost:hover { background: #f9fafb; }
.cdialog-btn--danger {
  border: 0;
  background: linear-gradient(90deg, #00b0ef, #0058cc);
  color: #fff;
}
.cdialog-btn--danger:hover {
  background: linear-gradient(90deg, #00a4e0, #004fb8);
  color: #fff;
}
