:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2b7de9;
  --border: #e5e7eb;
  --error: #d92d20;
  --success: #12b76a;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", "Noto Sans", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-y: scroll;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #edf3ff 0%, #f6f8fc 42%, #f3f6fa 100%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-form {
  margin: 0;
}

.lang-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.lang-label select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.brand img {
  display: block;
  height: 42px;
  width: auto;
}

.landing-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.landing-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: block;
}

.landing-hero {
  position: relative;
  left: 50%;
  width: 100vw;
  margin: 0;
  margin-left: -50vw;
  padding: 48px 24px 34px;
  overflow: hidden;
}

.landing-hero-bg {
  --mx: 0.5;
  --my: 0.4;
  position: absolute;
  inset: 0;
  border-radius: 0 0 30px 30px;
  background:
    radial-gradient(circle at calc(12% + (var(--mx) - 0.5) * 12%), 20%, rgba(54, 124, 255, 0.42), transparent 24%),
    radial-gradient(circle at calc(86% + (var(--mx) - 0.5) * -14%), calc(24% + (var(--my) - 0.5) * 10%), rgba(13, 197, 154, 0.32), transparent 22%),
    linear-gradient(135deg, #0e244a 0%, #143a73 44%, #135160 100%);
  box-shadow: inset 0 -22px 50px rgba(8, 20, 42, 0.16);
  pointer-events: none;
}

.landing-grid,
.landing-beam,
.landing-orb {
  position: absolute;
  display: block;
  z-index: 0;
}

.landing-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(160, 206, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 206, 255, 0.18) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.9;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 84%);
}

.landing-beam {
  width: 42%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(141, 206, 255, 0.92), transparent);
  box-shadow: 0 0 20px rgba(112, 189, 255, 0.45);
  opacity: 0.95;
}

.beam-a {
  top: 26%;
  left: -2%;
  transform: rotate(8deg);
  animation: heroBeamA 8s linear infinite;
}

.beam-b {
  top: 72%;
  right: -4%;
  transform: rotate(-10deg);
  animation: heroBeamB 9s linear infinite;
}

.landing-orb {
  border-radius: 999px;
  filter: blur(1px);
}

.orb-a {
  width: 16px;
  height: 16px;
  top: 18%;
  left: 12%;
  background: rgba(113, 187, 255, 0.95);
  box-shadow: 0 0 28px rgba(90, 173, 255, 0.78);
  animation: heroOrbA 5s ease-in-out infinite;
}

.orb-b {
  width: 18px;
  height: 18px;
  top: 58%;
  right: 14%;
  background: rgba(61, 228, 180, 0.9);
  box-shadow: 0 0 28px rgba(61, 228, 180, 0.55);
  animation: heroOrbB 6s ease-in-out infinite;
}

.landing-copy {
  position: relative;
  z-index: 1;
  padding: 36px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(188, 214, 248, 0.8);
  max-width: 820px;
  margin: 0 auto;
}

.landing-title {
  margin: 0 0 20px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.landing-text {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.landing-text p {
  margin: 0 0 16px;
}

.landing-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.landing-actions-bottom {
  margin-top: 36px;
}

.landing-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.landing-faq {
  padding: 28px;
  background: rgba(255, 255, 255, 0.88);
}

.landing-faq h2 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.25;
}

.landing-faq p,
.landing-faq li {
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.landing-faq p {
  margin: 0;
}

.landing-faq ol {
  margin: 14px 0 0;
  padding-left: 20px;
}

.landing-faq li + li {
  margin-top: 8px;
}

.landing-faq-wide {
  grid-column: 1 / -1;
}

@keyframes heroBeamA {
  0% { transform: translateX(-6%) rotate(8deg); opacity: 0.18; }
  50% { transform: translateX(22%) rotate(8deg); opacity: 0.75; }
  100% { transform: translateX(48%) rotate(8deg); opacity: 0.18; }
}

@keyframes heroBeamB {
  0% { transform: translateX(6%) rotate(-10deg); opacity: 0.14; }
  50% { transform: translateX(-18%) rotate(-10deg); opacity: 0.72; }
  100% { transform: translateX(-42%) rotate(-10deg); opacity: 0.14; }
}

@keyframes heroOrbA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(26px, 16px, 0); }
}

@keyframes heroOrbB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-22px, -14px, 0); }
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 246, 248, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 4;
}

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

.trial-welcome-card {
  width: min(100%, 560px);
}

.trial-welcome-card h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

.trial-welcome-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.auth-card form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}

.auth-card .btn.primary {
  width: 100%;
}

.success {
  background: rgba(18, 183, 106, 0.1);
  color: var(--success);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.layout {
  display: flex;
  min-height: calc(100vh - 64px);
  overflow-x: hidden;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  padding: 24px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.nav-item {
  display: block;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(43, 125, 233, 0.12);
  color: var(--primary);
}

.content {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.layout-paywall {
  display: block;
}

.content-paywall {
  max-width: 760px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.paywall-card {
  margin-top: 24px;
}

.paywall-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff4e5;
  border: 1px solid #ffd8a8;
  color: #9a4d00;
  font-size: 13px;
  font-weight: 600;
}

.paywall-card h2 {
  margin-top: 0;
}

.paywall-points {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

.paywall-point {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfd;
}

.paywall-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}

.paywall-option {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.paywall-option h3 {
  margin: 0 0 8px;
}

.paywall-option p {
  margin: 0 0 12px;
}

.paywall-option .btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.warning-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f7d48b;
  background: #fff7e6;
  color: #7a4b00;
}

.warning-banner strong {
  white-space: nowrap;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
}

.stat-number {
  font-size: 42px;
  font-weight: 700;
}

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

.form-grid label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 6px;
  font-size: 14px;
  background: #fff;
}

.actions {
  margin-top: 10px;
}

.billing-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.billing-form label {
  display: block;
  font-weight: 500;
}

.billing-form input,
.billing-form select {
  font-size: 13px;
}

.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  background: #eef2ff;
  color: #1f2937;
}

.btn.ghost {
  background: #f3f4f6;
  color: #374151;
}

.error {
  background: rgba(217, 45, 32, 0.1);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.notice {
  background: rgba(18, 183, 106, 0.1);
  color: var(--success);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

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

.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.timezone-setting {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.timezone-setting select {
  margin-top: 8px;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link-active {
  color: var(--text);
}

.account-card {
  max-width: 860px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.account-meta {
  display: grid;
  gap: 12px;
}

.account-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px 16px;
}

.account-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-value {
  display: block;
  font-weight: 600;
  word-break: break-word;
}

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

.account-secondary-form {
  margin-top: 8px;
}

.account-form label {
  display: block;
}

.account-form input {
  width: 100%;
  margin-top: 8px;
}

.account-side-note {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.message-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.chart-wrap {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: max-content minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
}

.dashboard-grid h2 {
  margin-top: 8px;
}

.dashboard-help {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
  max-width: 360px;
}

.dashboard-help h3 {
  margin-top: 8px;
}

.link-inline {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e5e7eb;
}

.tag-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.tag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.tag-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.code-block {
  background: #0b1220;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-actions {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 8px;
}

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

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

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

.report-table th {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.report-table tfoot td {
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.message-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.message-item:hover {
  background: #f8fafc;
  border-color: #dbeafe;
}

.inline {
  margin-left: auto;
}

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

.message-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
}

.message-title {
  font-weight: 600;
}

.message-meta {
  color: var(--muted);
  font-size: 13px;
}

.variant-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.variant-block h4 {
  margin: 0 0 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  padding: 16px;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: min(640px, 92vw);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.modal-preview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #f3f4f6;
  object-fit: cover;
}

.modal-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-body-text {
  color: var(--muted);
}

.modal-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.modal-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.modal-variant-info {
  color: var(--muted);
  font-size: 13px;
}

.modal-variant-grid {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.variant-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  gap: 12px;
}

.variant-control-title {
  font-weight: 600;
}

.variant-control-counter {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.variant-control-buttons {
  display: inline-flex;
  gap: 6px;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-card {
  max-width: 360px;
  margin: 64px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-top: 0;
}

.auth-footer {
  margin-top: 12px;
  text-align: center;
}

.success {
  background: #eafaf2;
  border: 1px solid #b7f0d1;
  color: #11643a;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .landing-main {
    padding-top: 0;
  }

  .landing-hero {
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    padding-inline: 18px;
    padding-top: 36px;
    padding-bottom: 24px;
  }

  .landing-title {
    font-size: 30px;
  }

  .landing-copy {
    padding: 28px;
  }

  .landing-nav {
    gap: 14px;
  }

  .landing-faq-grid {
    grid-template-columns: 1fr;
  }

  .landing-faq-wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beam-a,
  .beam-b,
  .orb-a,
  .orb-b {
    animation: none;
  }
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
}

.tab.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1f2937;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-right: 6px;
}

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

.billing-form-inline {
  margin-top: 8px;
}

.input-mini {
  max-width: 140px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.search-input {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

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

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .content {
    padding: 20px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .paywall-options {
    grid-template-columns: 1fr;
  }
}

.legal-footer {
  width: 100%;
  padding: 18px 24px 28px;
  text-align: center;
}

.legal-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.legal-sep {
  color: var(--muted);
  opacity: 0.7;
}

.legal-page-footer,
.auth-page-footer,
.landing-footer,
.panel-footer {
  margin-top: auto;
}

.legal-body {
  background: #f6f8fb;
}

.legal-main {
  width: min(940px, calc(100% - 32px));
  margin: 24px auto 0;
}

.legal-card {
  padding: 32px;
}

.legal-card h1,
.legal-card h2,
.legal-card h3 {
  color: var(--text);
}

.legal-card h1 {
  margin-top: 0;
  margin-bottom: 18px;
}

.legal-card h2 {
  margin-top: 28px;
  margin-bottom: 12px;
}

.legal-card h3 {
  margin-top: 22px;
  margin-bottom: 10px;
}

.legal-card p,
.legal-card li {
  line-height: 1.65;
  color: #334155;
}

.legal-card ul {
  padding-left: 20px;
}

.brand a {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .legal-main {
    width: min(100%, calc(100% - 20px));
  }

  .legal-card {
    padding: 22px;
  }

  .legal-links {
    font-size: 13px;
  }
}
