  .tide-calculator {
    --n-bg: #fff;
    --n-bg-muted: #f1f5f9;
    --n-text: #0f172a;
    --n-text-muted: #475569;
    --n-text-dim: #64748b;
    --n-border: #e2e8f0;
    --n-shadow: rgba(0, 0, 0, 0.05);
    --n-primary: #3b82f6;
    --n-primary-on: #fff;
    --n-accent: #6366f1;
    --n-cyan: #0891b2;
    --n-success: #10b981;
    --n-warning: #f59e0b;
    --n-error: #f43f5e;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
  }

  .tide-calculator,
  .tide-calculator * {
    box-sizing: border-box;
  }

  .theme-dark .tide-calculator {
    --n-bg: #0f172a;
    --n-bg-muted: #1e293b;
    --n-text: #f8fafc;
    --n-text-muted: #94a3b8;
    --n-text-dim: #64748b;
    --n-border: #334155;
    --n-shadow: rgba(0, 0, 0, 0.3);
    --n-primary: #60a5fa;
    --n-primary-on: #fff;
    --n-accent: #818cf8;
    --n-cyan: #22d3ee;
    --n-success: #34d399;
    --n-warning: #fbbf24;
    --n-error: #fb7185;
  }

  .tc-main-card {
    background: var(--n-bg);
    border: 1px solid var(--n-border);
    border-radius: 2rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--n-shadow);
    min-width: 0;
  }

  @media (max-width: 850px) {
    .tc-main-card {
      grid-template-columns: 1fr;
    }
  }

  .tc-calc-sidebar {
    background: var(--n-primary);
    color: var(--n-primary-on);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
  }

  .tc-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .tc-sidebar-header h3 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    overflow-wrap: anywhere;
  }

  #invert-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--n-primary-on);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  #invert-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .tc-input-set {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .tc-input-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .tc-input-block label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--n-primary-on);
    opacity: 0.85;
  }

  .tc-input-block .row {
    display: flex;
    gap: 0.5rem;
  }

  .tide-calculator input[type='time'],
  .tide-calculator input[type='number'] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.8rem;
    padding: 0.8rem;
    color: var(--n-primary-on);
    font-size: 1rem;
    outline: none;
    min-width: 0;
    width: 100%;
  }

  .tc-unit-input {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
  }

  .tc-unit-input input {
    width: 100%;
    padding-right: 25px;
  }

  .tc-unit-input span {
    position: absolute;
    right: 10px;
    font-size: 0.8rem;
    opacity: 0.5;
  }

  .tc-featured label {
    color: var(--n-primary-on);
    opacity: 1;
    font-size: 0.95rem;
  }

  .tide-calculator input[type='time'].large-time {
    background: var(--n-primary-on);
    color: var(--n-primary);
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
  }

  .tc-calc-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: var(--n-bg-muted);
    min-width: 0;
  }

  .tc-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .tc-result-display {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .tc-result-display .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--n-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .tc-value-box {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;
  }

  #target-value {
    font-size: 4rem;
    font-weight: 800;
    color: var(--n-accent);
    line-height: 1;
  }

  .tc-value-box small {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--n-text-dim);
  }

  .tc-status-indicator {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    width: fit-content;
    background: var(--n-bg-muted);
    color: var(--n-text-dim);
  }

  .tc-status-indicator.up {
    background: color-mix(in srgb, var(--n-success), transparent 80%);
    color: var(--n-success);
  }

  .tc-status-indicator.down {
    background: color-mix(in srgb, var(--n-error), transparent 80%);
    color: var(--n-error);
  }

  .tc-summary-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .tc-stat {
    display: flex;
    flex-direction: column;
    text-align: right;
  }

  .tc-s-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--n-text-muted);
    text-transform: uppercase;
  }

  .tc-stat span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--n-text);
  }

  .tc-chart-area {
    background: var(--n-bg);
    border: 1px solid var(--n-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    height: 250px;
    position: relative;
    min-width: 0;
  }

  .tc-table-card {
    background: var(--n-bg);
    border: 1px solid var(--n-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
  }

  .tc-table-card h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--n-text-muted);
  }

  .tc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tide-calculator table {
    width: 100%;
    border-collapse: collapse;
  }

  .tide-calculator th {
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--n-text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--n-bg-muted);
  }

  .tide-calculator td {
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--n-text-muted);
    border-bottom: 1px solid var(--n-bg-muted);
  }

  @media (max-width: 640px) {
    .tide-calculator {
      gap: 1rem;
    }

    .tc-main-card {
      border-radius: 1rem;
      box-shadow: 0 10px 24px var(--n-shadow);
    }

    .tc-calc-sidebar {
      padding: 1.25rem;
      gap: 1.25rem;
    }

    .tc-sidebar-header h3 {
      font-size: 0.95rem;
    }

    #invert-btn {
      width: 40px;
      height: 40px;
      flex: 0 0 auto;
    }

    .tc-input-set {
      gap: 1rem;
    }

    .tc-input-block .row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(92px, 0.75fr);
    }

    .tide-calculator input[type='time'],
    .tide-calculator input[type='number'] {
      padding: 0.75rem;
      font-size: 1rem;
    }

    .tide-calculator input[type='time'].large-time {
      font-size: 1.45rem;
    }

    .tc-calc-content {
      padding: 1.25rem;
      gap: 1.25rem;
    }

    .tc-top-row {
      display: grid;
      grid-template-columns: 1fr;
      gap: 1.25rem;
    }

    .tc-result-display .label {
      font-size: 0.75rem;
    }

    #target-value {
      font-size: 3rem;
    }

    .tc-value-box small {
      font-size: 1rem;
    }

    .tc-summary-info {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.75rem;
      justify-content: stretch;
    }

    .tc-stat {
      background: var(--n-bg);
      border: 1px solid var(--n-border);
      border-radius: 0.8rem;
      padding: 0.75rem;
      text-align: left;
    }

    .tc-chart-area {
      height: 220px;
      border-radius: 1rem;
      padding: 0.75rem;
    }

    .tc-table-card {
      border-radius: 1rem;
      padding: 1rem;
    }

    .tide-calculator th,
    .tide-calculator td {
      padding: 0.75rem 0.6rem;
      font-size: 0.82rem;
      white-space: nowrap;
    }
  }

  @media (max-width: 380px) {
    .tc-calc-sidebar,
    .tc-calc-content {
      padding: 1rem;
    }

    .tc-input-block .row,
    .tc-summary-info {
      grid-template-columns: 1fr;
    }

    #target-value {
      font-size: 2.6rem;
    }
  }
