.coffee-timer {
    --timer-bg: #fffbf7;
    --timer-surface: #fff;
    --timer-border: #e8d5bb;
    --timer-accent: #b5651d;
    --timer-accent-light: #d4845a;
    --timer-text: #3d2008;
    --timer-text-muted: #8d735b;
    --timer-bloom: #d97706;
    --timer-pour: #0284c7;
    --timer-drain: #64748b;
    --timer-success: #16a34a;

    width: 100%;
    max-width: 600px;
    margin: 0 auto 4rem;
  }

  .theme-dark .coffee-timer {
    --timer-bg: #1a120b;
    --timer-surface: #251b13;
    --timer-border: #3d2a1c;
    --timer-accent: #e8a87c;
    --timer-accent-light: #f3c9ad;
    --timer-text: #f5e6d3;
    --timer-text-muted: #b59b84;
    --timer-bloom: #fbbf24;
    --timer-pour: #38bdf8;
    --timer-drain: #94a3b8;
  }

  .timer-card {
    background: var(--timer-surface);
    border: 2px solid var(--timer-border);
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(61, 32, 8, 0.08);
    position: relative;
    overflow: hidden;
  }

  .timer-phase-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
  }

  .timer-progress-bar {
    height: 100%;
    width: 0%;
    transition: width 0.1s linear, background-color 0.5s ease;
  }

  .timer-progress-bar.bloom {
    background-color: var(--timer-bloom);
  }

  .timer-progress-bar.pour {
    background-color: var(--timer-pour);
  }

  .timer-progress-bar.drain {
    background-color: var(--timer-drain);
  }

  .timer-display {
    text-align: center;
    margin-bottom: 2rem;
  }

  .timer-time {
    font-size: 6rem;
    font-weight: 900;
    color: var(--timer-text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
  }

  .timer-phase-name {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--timer-text-muted);
  }

  .timer-instruction-box {
    background: var(--timer-bg);
    border: 2px solid var(--timer-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
  }

  .instruction-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--timer-text);
  }

  .instruction-hint {
    font-size: 1rem;
    color: var(--timer-text-muted);
    font-weight: 500;
  }

  .timer-target-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 1rem;
    background: rgba(181, 101, 29, 0.05);
    border-radius: 1rem;
  }

  .target-label {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--timer-accent);
  }

  .target-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--timer-text);
  }

  .target-unit {
    font-size: 1.25rem;
    color: var(--timer-text-muted);
    margin-left: 0.25rem;
  }

  .timer-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .main-start-btn {
    width: 100%;
    padding: 2rem;
    border-radius: 1.5rem;
    border: none;
    background: var(--timer-accent);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 8px 20px rgba(181, 101, 29, 0.3);
  }

  .main-start-btn:hover {
    transform: translateY(-2px);
    background: var(--timer-accent-light);
    box-shadow: 0 12px 24px rgba(181, 101, 29, 0.4);
  }

  .main-start-btn:active {
    transform: translateY(1px);
  }

  .secondary-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .secondary-controls.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .control-btn {
    padding: 1.25rem;
    border-radius: 1.25rem;
    border: 2px solid var(--timer-border);
    background: var(--timer-surface);
    color: var(--timer-text);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .control-btn:hover {
    background: var(--timer-bg);
  }

  .btn-pause {
    background: var(--timer-accent);
    color: #fff;
    border-color: var(--timer-accent);
    flex: 2;
  }

  .btn-pause:hover {
    background: var(--timer-accent-light);
    border-color: var(--timer-accent-light);
  }

  .btn-reset {
    color: #dc2626;
    border-color: #fecaca;
    flex: 1;
  }

  .btn-reset:hover {
    background: #fef2f2;
    border-color: #dc2626;
  }

  .btn-pause.active {
    background: var(--timer-text);
    color: #fff;
    border-color: var(--timer-text);
  }

  .timer-setup {
    margin-top: 3rem;
    border-top: 1px solid var(--timer-border);
    padding-top: 2rem;
  }

  .setup-title {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--timer-text-muted);
    margin-bottom: 1.5rem;
  }

  .setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }

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

  .input-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--timer-text-muted);
  }

  .setup-input {
    background: var(--timer-bg);
    border: 2px solid var(--timer-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--timer-text);
    outline: none;
    transition: border-color 0.2s;
    appearance: textfield;
  }

  .setup-input::-webkit-inner-spin-button,
  .setup-input::-webkit-outer-spin-button {
    appearance: none;
  }

  .setup-input:focus {
    border-color: var(--timer-accent);
  }

  .summary-overlay {
    position: absolute;
    inset: 0;
    background: var(--timer-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  .summary-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .summary-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--timer-success);
    margin-bottom: 1rem;
  }

  .summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
  }

  .stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--timer-text-muted);
  }

  .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--timer-text);
  }

  .close-summary-btn {
    padding: 1rem 2.5rem;
    background: var(--timer-text);
    color: #fff;
    border: none;
    border-radius: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
  }

  .close-summary-btn:hover {
    opacity: 0.9;
  }

  @media (max-width: 480px) {
    .timer-card {
      padding: 1.5rem 1rem;
    }

    .timer-time {
      font-size: 3.5rem;
    }

    .target-value {
      font-size: 1.75rem;
    }

    .setup-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }

    .setup-input {
      font-size: 1.1rem;
      padding: 0.6rem 0.875rem;
    }

    .instruction-text {
      font-size: 1.25rem;
    }
  }

  .timer-hidden {
    display: none;
  }