:root {
  --bg: #f8fafc;
  --bg-hero: radial-gradient(ellipse 64rem 30rem at 50% -4rem, rgba(79, 70, 229, 0.11), rgba(154, 255, 206, 0.06) 48%, transparent 80%);
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-hover: #f8fafc;
  --surface-expired: #f8fafc;
  --header-bg: rgba(248, 250, 252, 0.86);
  --input-bg: #ffffff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #4536bc;
  --primary-btn: #4536bc;
  --primary-hover: #382b9e;
  --primary-soft: #eef2ff;
  --primary-soft-hover: #e0e7ff;
  --primary-border: #c7d2fe;
  --focus-ring: rgba(69, 54, 188, 0.2);
  --result-bg: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
  --promo-bg: linear-gradient(135deg, #ffffff 0%, #f4f5ff 100%);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-studio: 0 20px 48px -18px rgba(30, 27, 75, 0.14), 0 2px 8px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg-hero: radial-gradient(ellipse 64rem 30rem at 50% -4rem, rgba(99, 102, 241, 0.2), rgba(52, 211, 153, 0.06) 48%, transparent 80%);
  --surface: #111827;
  --surface-subtle: #192338;
  --surface-hover: #1e293b;
  --surface-expired: #0d1322;
  --header-bg: rgba(9, 13, 22, 0.84);
  --input-bg: #0c1220;
  --border: #222f46;
  --border-hover: #364869;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-btn: #5b54f0;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(129, 140, 248, 0.14);
  --primary-soft-hover: rgba(129, 140, 248, 0.24);
  --primary-border: rgba(129, 140, 248, 0.34);
  --focus-ring: rgba(129, 140, 248, 0.26);
  --result-bg: linear-gradient(180deg, #111827 0%, #141e36 100%);
  --promo-bg: linear-gradient(135deg, #111827 0%, #17203a 100%);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --danger-border: rgba(248, 113, 113, 0.35);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --success-border: rgba(52, 211, 153, 0.34);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.42);
  --shadow-studio: 0 24px 56px -18px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-hero);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-main {
  flex: 1;
}

/* --- Sticky Minimalist Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-lockup {
  display: block;
  width: 7.4rem;
  height: auto;
}

[data-theme="dark"] .logo-lockup {
  content: url('/qikurl-logo.svg#dark');
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.primary-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.user-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.icon-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-subtle);
}

/* --- Hero & Shortener Studio --- */
.hero-section {
  padding: clamp(2.25rem, 5vw, 3.75rem) 0 1.25rem;
}

.hero-container {
  max-width: 840px;
}

.hero-copy {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 1.65rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: clamp(2.05rem, 5.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: clamp(0.98rem, 2.1vw, 1.12rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

.hero-subtitle strong {
  color: var(--text);
  font-weight: 600;
}

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

.studio-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-studio);
  padding: clamp(1.15rem, 3.2vw, 2rem);
}

.hero-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  background: var(--surface-subtle);
  padding: 0.28rem;
  border-radius: 10px;
  margin-bottom: 1.2rem;
}

.hero-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.hero-tab:hover {
  color: var(--text);
}

.hero-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Primary URL Input + Action Bar */
.shorten-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: stretch;
}

.url-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1.5px solid var(--border-hover);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.url-field-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.url-field-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.url-field-wrap input[type="url"],
.url-field-wrap input[type="text"],
.url-field-wrap input {
  width: 100%;
  min-height: 3.45rem;
  padding: 0.8rem 4.75rem 0.8rem 2.85rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 1.02rem;
  color: var(--text);
}

.url-field-wrap input:focus {
  outline: none;
  box-shadow: none;
}

.input-quick-btn {
  position: absolute;
  right: 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.input-quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.shorten-cta {
  min-height: 3.45rem;
  padding: 0 1.7rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  width: auto !important;
  box-shadow: 0 6px 18px -4px rgba(69, 54, 188, 0.4);
}

/* Progressive Link Options Drawer */
.link-options {
  margin-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.link-options summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.15rem 0.25rem;
  cursor: pointer;
  user-select: none;
}

.link-options summary::-webkit-details-marker {
  display: none;
}

.summary-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.link-options summary:hover .summary-left {
  color: var(--primary);
}

.summary-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.options-body {
  padding-top: 0.9rem;
}

/* Trust micro-strip inside Studio Card */
.studio-trust-row {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
}

.trust-pills {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.95rem;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-pills li {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.trust-pills li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
}

.legal-consent {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.legal-consent a,
.legal-doc a,
.faq-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.legal-consent a:hover,
.legal-doc a:hover,
.faq-item a:hover {
  text-decoration: underline;
}

/* --- Form Fields & Buttons --- */
.field {
  margin-bottom: 0.95rem;
}

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.38rem;
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
}

.field-row {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.9rem;
}

.qr-color-row {
  grid-template-columns: 1fr 1fr;
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.68rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

:where(input[type="url"], input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-prefix-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--input-bg);
}

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

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.84rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.input-prefix-group input {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.input-prefix-group input:focus,
.input-prefix-group select:focus {
  box-shadow: none;
}

.domain-select {
  width: auto;
  max-width: 170px;
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0 0.65rem;
}

/* UTM Builder */
.utm-section {
  margin-bottom: 0.4rem;
}

.utm-toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
}

.utm-toggle-btn:hover {
  text-decoration: underline;
}

.utm-panel {
  margin-top: 0.65rem;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.utm-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.utm-presets-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-clear {
  color: var(--text-muted);
}

.utm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.utm-grid .field {
  margin-bottom: 0;
}

.utm-preview {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
}

.color-input {
  width: 100%;
  height: 42px;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  cursor: pointer;
}

.standalone-qr-result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

.standalone-qr-result img {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  padding: 0.72rem 1.2rem;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-btn);
  color: #ffffff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary.is-copied,
.btn-secondary.is-copied {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-soft-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-subtle);
  border-color: var(--border-hover);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.42rem 0.78rem;
  width: auto;
}

.inline-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  margin-top: 0.85rem;
  margin-bottom: 0.5rem;
}

.turnstile-slot {
  margin-top: 0.85rem;
}

/* --- Result Card --- */
.result-card {
  margin-top: 1.15rem;
  border-color: var(--primary-border);
  background: var(--result-bg);
  border-radius: var(--radius-lg);
}

.result-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.result-details {
  flex: 1;
  min-width: 0;
}

.result-label-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.result-url-row {
  margin-bottom: 0.75rem;
}

.short-url-link {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

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

.result-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.result-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.result-qr img {
  width: 124px;
  height: 124px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 4px;
}

/* --- Main Content Stack --- */
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 1.25rem;
  padding-bottom: 3.5rem;
}

/* --- CLS-Safe AdSense Containers --- */
.ad-unit {
  width: 100%;
  margin: 0.25rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.ad-unit-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ad-unit-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  border: 1px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ad-unit-leaderboard .ad-unit-frame {
  max-width: 728px;
  min-height: 90px;
}

.ad-unit-rectangle .ad-unit-frame {
  max-width: 728px;
  min-height: 250px;
}

.ad-preview-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1rem;
  text-align: center;
}

/* --- Workspace / History Card --- */
.history-card.is-empty-workspace {
  display: none;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-header h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.guest-banner {
  background: var(--primary-soft);
  color: var(--text-secondary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.83rem;
  margin-bottom: 0.9rem;
}

.history-search {
  margin-bottom: 0.95rem;
}

.search-input {
  background: var(--surface-subtle);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.badge-clicks {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-expired {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-active {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-platform {
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 1.75rem 1rem;
  font-size: 0.9rem;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.link-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.link-item:hover {
  border-color: var(--border-hover);
}

.link-item.is-expired {
  opacity: 0.72;
  background: var(--surface-expired);
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.link-short {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

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

.link-original {
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

/* --- Creator / Marketing Free Account Promo Card --- */
.promo-card {
  background: var(--promo-bg);
  border-color: var(--primary-border);
  padding: clamp(1.35rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.promo-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.promo-copy h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.promo-copy p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  max-width: 58ch;
}

.promo-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.promo-pills li {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.promo-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 205px;
}

.promo-note {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* --- Marketing & Feature Grid Sections --- */
.marketing-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.45rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.15s, transform 0.15s;
}

.feature-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.feature-card code,
.steps-card code,
.utility-card code,
.faq-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--surface-subtle);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  color: var(--text);
}

/* --- How It Works + Utility Cards --- */
.split-showcase {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.15rem;
  align-items: stretch;
}

.steps-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.steps-list h3 {
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.steps-list p {
  font-size: 0.87rem;
  color: var(--text-muted);
}

.utility-cards {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.utility-card {
  flex: 1;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}

.utility-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.utility-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.96rem;
}

.utility-card-top span {
  color: var(--primary);
  font-weight: 700;
}

.utility-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1.2rem;
  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: var(--primary-border);
}

.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 0;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--primary);
  line-height: 1;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding-bottom: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- Subpage / Trust Page Layout --- */
.subpage-hero {
  text-align: center;
  padding: clamp(2rem, 4vw, 3rem) 0 1.5rem;
  max-width: 680px;
  margin: 0 auto;
}

.subpage-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}

.subpage-hero p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.subpage-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.legal-doc h2 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
}

.legal-doc h2:first-child {
  margin-top: 0;
}

.legal-doc p,
.legal-doc li {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  line-height: 1.65;
}

.legal-doc ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

/* --- Site Footer --- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.75rem;
}

.footer-logo {
  width: 6.8rem;
  margin-bottom: 0.65rem;
}

.footer-tagline {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 38ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.footer-col h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.footer-col a {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: none;
  width: fit-content;
}

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

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Modals, DNS, Keys, Bulk & Analytics --- */
.dns-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  word-break: break-all;
}

.dns-box code {
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.58);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 350px;
  padding: 1.35rem;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.4);
}

.edit-modal-content {
  max-width: 450px;
}

.edit-short-url {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
  margin-bottom: 1rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.modal-body img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.modal-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.modal-actions-end {
  justify-content: flex-end;
  width: 100%;
  margin-top: 0.5rem;
}

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: var(--surface-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.modal-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.modal-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.key-create-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.key-secret-box {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}

.key-secret-note {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.key-secret-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-secret-row code {
  flex: 1;
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--surface);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.key-usage-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.84rem;
}

.key-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bulk-textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.bulk-results {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bulk-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-subtle);
}

.bulk-result-item.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-modal-content {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

.admin-section {
  margin-bottom: 1.25rem;
}

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

.admin-section h4 {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.report-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.report-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.report-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.analytics-modal-content {
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
}

.analytics-subtitle {
  font-size: 0.82rem;
  color: var(--primary);
  word-break: break-all;
}

.analytics-range-bar {
  margin-bottom: 1rem;
}

.analytics-tabs {
  max-width: 260px;
  margin-bottom: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.kpi-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-value-sm {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}

.analytics-panel h4 {
  font-size: 0.84rem;
  margin-bottom: 0.65rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding-top: 0.5rem;
}

.bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.bar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 2px 2px;
  min-height: 2px;
  transition: height 0.2s ease;
}

.bar-fill.is-zero {
  background: var(--border);
  opacity: 0.65;
}

.bar-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.breakdown-grid .analytics-panel {
  margin-bottom: 0;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.breakdown-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.breakdown-bar-bg {
  height: 6px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.analytics-privacy-note {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 860px) {
  .primary-nav {
    display: none;
  }

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

  .split-showcase,
  .promo-card {
    grid-template-columns: 1fr;
  }

  .promo-action {
    align-items: stretch;
    min-width: 0;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .nav-shell {
    padding: 0.65rem 1rem;
  }

  .logo-lockup {
    width: 6.3rem;
  }

  .shorten-bar {
    grid-template-columns: 1fr;
  }

  .shorten-cta {
    width: 100% !important;
  }

  .summary-hint {
    display: none;
  }

  .field-row,
  .utm-grid,
  .feature-grid,
  .breakdown-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .result-content,
  .link-item {
    flex-direction: column;
    align-items: stretch;
  }

  .result-details,
  .link-info {
    width: 100%;
    max-width: 100%;
  }

  .result-qr {
    align-self: center;
  }

  .link-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .key-create-row {
    flex-direction: column;
  }

  .key-create-row .btn {
    width: 100%;
  }

  .studio-trust-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
