:root {
      --sand-bg: #f9f6f0;
      --ocean-deep: #007791;
      --ocean-foam: #e0f7fa;
      --sunset-coral: #ff7e5f;
      --sunset-yellow: #feb47b;
      --text-dark: #1f3c4d;
      --card-bg: #ffffff;
    }

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

    body {
      font-family: 'Outfit', system-ui, -apple-system, sans-serif;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      background: linear-gradient(135deg, #e0f7fa 0%, #f9f6f0 50%, #ffe0b2 100%);
      color: var(--text-dark);
      padding: 1.5rem;
    }

    /* Main Container with Soft Curved Borders */
    .surf-card {
      background: var(--card-bg);
      padding: 2.5rem 2rem;
      border-radius: 32px;
      box-shadow: 0 20px 40px rgba(0, 119, 145, 0.12);
      max-width: 480px;
      width: 100%;
      text-align: center;
      border: 4px solid #ffffff;
      position: relative;
      overflow: hidden;
    }

    /* Beach Wave Accent Line */
    .surf-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 8px;
      background: linear-gradient(90deg, var(--ocean-deep), var(--sunset-coral), var(--sunset-yellow));
    }

    .surf-badge {
      display: inline-block;
      background-color: var(--ocean-foam);
      color: var(--ocean-deep);
      font-size: 0.85rem;
      font-weight: 600;
      padding: 6px 16px;
      border-radius: 50px;
      margin-bottom: 1.25rem;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    h1 {
      font-size: 2rem;
      font-weight: 800;
      color: var(--ocean-deep);
      margin-bottom: 0.75rem;
      line-height: 1.2;
    }

    p {
      font-size: 1rem;
      color: #5a7384;
      line-height: 1.5;
      margin-bottom: 2rem;
    }

    /* Rounded Ocean-Style Button */
    button {
      background: linear-gradient(135deg, var(--sunset-coral), var(--sunset-yellow));
      color: white;
      border: none;
      padding: 16px 28px;
      font-size: 1.05rem;
      font-family: inherit;
      font-weight: 600;
      border-radius: 50px;
      cursor: pointer;
      width: 100%;
      box-shadow: 0 8px 20px rgba(255, 126, 95, 0.35);
      transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    }

    button:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 24px rgba(255, 126, 95, 0.45);
      filter: brightness(1.05);
    }

    button:active {
      transform: translateY(0);
      box-shadow: 0 4px 12px rgba(255, 126, 95, 0.25);
    }

    button.subscribed {
      background: linear-gradient(135deg, var(--ocean-deep), #0097a7);
      box-shadow: 0 8px 20px rgba(0, 119, 145, 0.3);
    }

    button.subscribed:hover {
      box-shadow: 0 12px 24px rgba(0, 119, 145, 0.4);
    }

    button.subscribed:active {
      box-shadow: 0 4px 12px rgba(0, 119, 145, 0.25);
    }

    button:disabled {
      opacity: 0.7;
      cursor: wait;
      transform: none;
    }

    /* Own measurements graph */
    .wind-graph-section {
      margin-top: 1.75rem;
      padding-top: 1.25rem;
      border-top: 1px dashed #d1e5ed;
      text-align: left;
    }

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

    .wind-graph-section h2 {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--ocean-deep);
      margin: 0;
    }

    .wind-graph-current {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: flex-end;
      align-items: center;
      gap: 0.4rem 0.55rem;
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--ocean-deep);
      margin: 0;
      white-space: normal;
      line-height: 1.25;
      text-align: right;
      max-width: 18rem;
    }

    .wind-graph-current .wind-graph-speeds {
      display: inline;
    }

    .wind-graph-current .wind-graph-gust {
      color: var(--sunset-coral);
      font-size: 0.85rem;
      font-weight: 700;
      margin-left: 0.35rem;
    }

    .wind-graph-current .wind-graph-unit {
      font-size: 0.7rem;
      font-weight: 600;
      color: #5a7384;
      margin-left: 0.15rem;
    }

    .wind-graph-current .wind-graph-dir {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      margin: 0;
      padding: 0.28rem 0.5rem 0.28rem 0.3rem;
      border-radius: 999px;
      background: #eef7fa;
      border: 1px solid #d3e8ef;
      vertical-align: middle;
      text-align: left;
    }

    .wind-graph-current .wind-graph-dir-compass {
      position: relative;
      flex: 0 0 auto;
      width: 1.55rem;
      height: 1.55rem;
      border-radius: 50%;
      border: 1.5px solid #9fc3d1;
      background: #fff;
    }

    .wind-graph-current .wind-graph-dir-compass::before,
    .wind-graph-current .wind-graph-dir-compass::after {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.4rem;
      font-weight: 700;
      color: #7a96a6;
      line-height: 1;
    }

    .wind-graph-current .wind-graph-dir-compass::before {
      content: 'N';
      top: 0.08rem;
    }

    .wind-graph-current .wind-graph-dir-compass::after {
      content: 'S';
      bottom: 0.08rem;
    }

    .wind-graph-current .wind-graph-dir-arrow {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      /* Arrow points where the wind is going (FROM + 180°). */
      transform: rotate(calc(var(--dir, 0deg) + 180deg));
    }

    .wind-graph-current .wind-graph-dir-arrow i {
      display: block;
      width: 0;
      height: 0;
      border-left: 0.18rem solid transparent;
      border-right: 0.18rem solid transparent;
      border-bottom: 0.42rem solid var(--ocean-deep);
      margin-top: -0.05rem;
    }

    .wind-graph-current .wind-graph-dir-text {
      display: flex;
      flex-direction: column;
      gap: 0.02rem;
      line-height: 1.15;
      min-width: 0;
    }

    .wind-graph-current .wind-graph-dir-text strong {
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--ocean-deep);
    }

    .wind-graph-current .wind-graph-dir-text em {
      font-size: 0.62rem;
      font-style: normal;
      font-weight: 600;
      color: #5a7384;
    }

    .wind-graph-legend {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.55rem 0.75rem;
      margin: 0.55rem 0 0;
      font-size: 0.72rem;
      font-weight: 600;
      color: #5a7384;
    }

    .wind-graph-legend-series {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
    }

    .wind-graph-legend-series span {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }

    .wind-graph-legend i {
      display: inline-block;
      width: 12px;
      height: 3px;
      border-radius: 2px;
    }

    .wind-graph-legend .swatch-avg {
      background: var(--ocean-deep);
    }

    .wind-graph-legend .swatch-gust {
      background: var(--sunset-coral);
    }

    .wind-graph-current .wind-graph-est {
      font-size: 0.72em;
      font-weight: 600;
      color: #5a7384;
      letter-spacing: 0.02em;
      margin-left: 0.15em;
    }

    .wind-unit-toggle {
      display: inline-flex;
      border: 1px solid #d1e5ed;
      border-radius: 999px;
      overflow: hidden;
      background: #f7fbfc;
    }

    .wind-unit-toggle button {
      margin: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: #5a7384;
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.68rem;
      font-weight: 700;
      padding: 0.28rem 0.55rem;
      min-width: 0;
      width: auto;
      box-shadow: none;
      letter-spacing: 0.01em;
      filter: none;
    }

    .wind-unit-toggle button:hover {
      transform: none;
      box-shadow: none;
      filter: none;
      background: rgba(0, 119, 145, 0.08);
    }

    .wind-unit-toggle button:active {
      transform: none;
      box-shadow: none;
      filter: none;
    }

    .wind-unit-toggle button.is-active {
      background: var(--ocean-deep);
      color: #fff;
    }

    .wind-unit-toggle button.is-active:hover {
      background: var(--ocean-deep);
      filter: brightness(1.05);
    }

    .wind-unit-toggle button:focus-visible {
      outline: 2px solid var(--sunset-coral);
      outline-offset: -2px;
      z-index: 1;
    }

    .wind-graph-wrap {
      position: relative;
      z-index: 3;
      width: 100%;
      height: 168px;
      border-radius: 16px;
      background: linear-gradient(180deg, #f4fafb 0%, #eef8f9 100%);
      border: 1px solid #e0f2f1;
      /* Allow hover tooltip to extend past the plot without being clipped. */
      overflow: visible;
    }

    .wind-graph-wrap.is-interactive {
      cursor: crosshair;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: none;
    }

    .wind-graph-wrap.is-interactive svg,
    .wind-graph-wrap.is-interactive svg * {
      user-select: none;
      -webkit-user-select: none;
    }

    .wind-graph-wrap svg {
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 16px;
    }

    .wind-graph-tooltip {
      position: absolute;
      z-index: 20;
      pointer-events: none;
      background: rgba(0, 55, 70, 0.92);
      color: #fff;
      font-size: 0.72rem;
      font-weight: 600;
      line-height: 1.35;
      padding: 0.4rem 0.55rem;
      border-radius: 8px;
      white-space: nowrap;
      box-shadow: 0 4px 14px rgba(0, 40, 55, 0.18);
      transform: translate(-50%, 0);
    }

    .wind-graph-tooltip[hidden] {
      display: none;
    }

    .wind-graph-tooltip .wg-time {
      opacity: 0.8;
      font-weight: 500;
      font-size: 0.68rem;
      margin-bottom: 0.1rem;
    }

    .wind-graph-tooltip .wg-gust {
      color: #ffb39f;
    }

    .wind-graph-tooltip .wg-est {
      color: #c5d9e2;
      font-weight: 600;
      font-size: 0.92em;
    }

    .wind-graph-tooltip .wg-dir {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      margin-top: 0.3rem;
      padding-top: 0.3rem;
      border-top: 1px solid rgba(168, 197, 212, 0.35);
      color: #d7eaf2;
      font-weight: 600;
    }

    .wind-graph-tooltip .wg-dir-compass {
      position: relative;
      flex: 0 0 auto;
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      border: 1.5px solid rgba(168, 197, 212, 0.55);
      background: rgba(0, 40, 55, 0.35);
    }

    .wind-graph-tooltip .wg-dir-compass::before,
    .wind-graph-tooltip .wg-dir-compass::after {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.45rem;
      font-weight: 700;
      color: rgba(168, 197, 212, 0.75);
      line-height: 1;
    }

    .wind-graph-tooltip .wg-dir-compass::before {
      content: 'N';
      top: 0.12rem;
    }

    .wind-graph-tooltip .wg-dir-compass::after {
      content: 'S';
      bottom: 0.12rem;
    }

    .wind-graph-tooltip .wg-dir-arrow {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      /* Arrow points where the wind is going (FROM + 180°). */
      transform: rotate(calc(var(--dir, 0deg) + 180deg));
    }

    .wind-graph-tooltip .wg-dir-arrow i {
      display: block;
      width: 0;
      height: 0;
      border-left: 0.22rem solid transparent;
      border-right: 0.22rem solid transparent;
      border-bottom: 0.55rem solid #7fd4ea;
      margin-top: -0.08rem;
      filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
    }

    .wind-graph-tooltip .wg-dir-text {
      display: flex;
      flex-direction: column;
      gap: 0.05rem;
      line-height: 1.2;
    }

    .wind-graph-tooltip .wg-dir-text strong {
      font-size: 0.78rem;
      font-weight: 700;
      color: #fff;
    }

    .wind-graph-tooltip .wg-dir-text span {
      font-size: 0.65rem;
      font-weight: 500;
      color: #a8c5d4;
    }

    .wind-graph-empty,
    .wind-graph-meta {
      font-size: 0.8rem;
      color: #5a7384;
      line-height: 1.4;
      margin: 0.65rem 0 0;
    }

    .wind-graph-accuracy-note {
      font-size: 0.78rem;
      color: #6a8292;
      line-height: 1.45;
      margin: 0.75rem 0 0;
      padding: 0.55rem 0 0;
      border-top: 1px dashed #d1e5ed;
      font-style: italic;
    }

    .wind-graph-empty {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      text-align: center;
      margin: 0;
    }

    .wind-graph-empty[hidden] {
      display: none;
    }

    .wind-graph-wrap.is-updating {
      animation: windGraphWrapPulse 0.9s ease-out;
    }

    .wind-graph-wrap.is-updating svg {
      animation: windGraphSvgReveal 0.75s ease-out;
    }

    .wind-graph-current.is-updating {
      animation: windGraphCurrentPulse 0.75s ease-out;
    }

    .wind-graph-meta.is-updating {
      animation: windGraphMetaPulse 0.9s ease-out;
    }

    @keyframes windGraphWrapPulse {
      0% {
        border-color: #e0f2f1;
        box-shadow: 0 0 0 0 rgba(0, 119, 145, 0);
      }
      35% {
        border-color: #007791;
        box-shadow: 0 0 0 4px rgba(0, 119, 145, 0.2);
      }
      100% {
        border-color: #e0f2f1;
        box-shadow: 0 0 0 0 rgba(0, 119, 145, 0);
      }
    }

    @keyframes windGraphSvgReveal {
      0% { opacity: 0.35; }
      100% { opacity: 1; }
    }

    @keyframes windGraphCurrentPulse {
      0%, 100% { filter: none; }
      40% { filter: brightness(1.35); }
    }

    @keyframes windGraphMetaPulse {
      0%, 100% { color: #5a7384; }
      40% { color: #007791; }
    }

    /* Foldable FAQ Section */
    .faq-section {
      margin-top: 1.75rem;
      padding-top: 1.25rem;
      border-top: 1px dashed #d1e5ed;
      text-align: left;
    }

    details {
      background: #f4fafb;
      border-radius: 16px;
      border: 1px solid #e0f2f1;
      padding: 0.85rem 1rem;
      transition: background 0.2s ease;
    }

    details[open] {
      background: #ffffff;
      border-color: #b2dfdb;
      box-shadow: 0 4px 12px rgba(0, 119, 145, 0.05);
    }

    summary {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--ocean-deep);
      cursor: pointer;
      list-style: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
    }

    summary::-webkit-details-marker {
      display: none;
    }

    summary::after {
      content: '➕';
      font-size: 0.8rem;
      transition: transform 0.2s ease;
    }

    details[open] summary::after {
      content: '➖';
    }

    .faq-container {
      margin-top: 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .faq-item {
      background: #f4fafb;
      border-radius: 12px;
      padding: 0.85rem;
      border: 1px solid #e0f2f1;
    }

    .faq-question {
      font-weight: 600;
      font-size: 0.88rem;
      color: var(--text-dark);
      margin-bottom: 0.35rem;
    }

    .faq-answer {
      font-size: 0.83rem;
      color: #5a7384;
      line-height: 1.4;
      margin-bottom: 0;
    }

    .faq-answer ol {
      margin-left: 1.1rem;
      margin-top: 0.35rem;
    }

    .faq-answer li {
      margin-bottom: 0.2rem;
    }

    .highlight-code {
      background: #e3f2fd;
      color: #0d47a1;
      padding: 2px 6px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 0.78rem;
    }

    /* Contact the owner */
    .contact-section {
      margin-top: 1.75rem;
      padding-top: 1.25rem;
      border-top: 1px dashed #d1e5ed;
      text-align: left;
    }

    .contact-section h2 {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--ocean-deep);
      margin-bottom: 0.4rem;
    }

    .contact-intro {
      font-size: 0.88rem;
      color: #5a7384;
      line-height: 1.45;
      margin-bottom: 1rem;
    }

    .contact-actions {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .contact-action {
      display: block;
      text-decoration: none;
      background: #f4fafb;
      border: 1px solid #e0f2f1;
      border-radius: 16px;
      padding: 1rem 1.1rem;
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    }

    .contact-action:hover {
      background: #ffffff;
      border-color: #b2dfdb;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 119, 145, 0.08);
    }

    .contact-action:active {
      transform: translateY(0);
    }

    .contact-action-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      font-size: 0.92rem;
      font-weight: 700;
      color: var(--ocean-deep);
      margin-bottom: 0.3rem;
    }

    .contact-action-label span:last-child {
      font-size: 0.85rem;
      opacity: 0.7;
    }

    .contact-action-desc {
      font-size: 0.8rem;
      color: #5a7384;
      line-height: 1.4;
      margin: 0;
    }

    .contact-action--business {
      background: linear-gradient(135deg, rgba(0, 119, 145, 0.06), rgba(255, 126, 95, 0.08));
      border-color: rgba(255, 126, 95, 0.25);
    }

    .contact-action--business:hover {
      border-color: var(--sunset-coral);
      box-shadow: 0 4px 14px rgba(255, 126, 95, 0.15);
    }

    /* Wind celebration overlay (subscribe success) */
    .wind-overlay {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 5;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .wind-overlay.is-active {
      opacity: 1;
    }

    .wind-overlay canvas {
      display: block;
      width: 100%;
      height: 100%;
    }

    .surf-card.is-blowing {
      animation: cardWhoosh 0.9s ease-out;
    }

    .surf-badge.is-fluttering {
      animation: badgeFlutter 0.85s ease-in-out;
    }

    @keyframes cardWhoosh {
      0% { transform: translateX(0); }
      18% { transform: translateX(-4px); }
      42% { transform: translateX(5px); }
      68% { transform: translateX(-2px); }
      100% { transform: translateX(0); }
    }

    @keyframes badgeFlutter {
      0%, 100% { transform: rotate(0deg) scale(1); }
      25% { transform: rotate(-6deg) scale(1.04); }
      55% { transform: rotate(5deg) scale(1.06); }
      80% { transform: rotate(-2deg) scale(1.02); }
    }

    @media (prefers-reduced-motion: reduce) {
      .surf-card.is-blowing,
      .surf-badge.is-fluttering,
      .wind-graph-wrap.is-updating,
      .wind-graph-wrap.is-updating svg,
      .wind-graph-current.is-updating,
      .wind-graph-meta.is-updating {
        animation: none;
      }
    }
