*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #0e0e10;
    --surface: #17171a;
    --surface2: #1f1f24;
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.14);
    --text: #f0efe8;
    --text-muted: #7a7a82;
    --text-dim: #3f3f47;
    --accent: #ff9600;
    --accent-dim: rgba(255, 150, 0, 0.08);
    --accent-border: rgba(255, 150, 0, 0.3);
    --green: #5ecf8a;
    --green-dim: rgba(94, 207, 138, 0.1);
    --red: #e06060;
    --red-dim: rgba(224, 96, 96, 0.1);
    --radius: 10px;
    --radius-lg: 16px;
  }

  html { background: var(--bg); color: var(--text); font-family: 'Syne', sans-serif; min-height: 100vh; }

  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 4rem;
    background-image:
      radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,150,0,0.06) 0%, transparent 70%),
      radial-gradient(ellipse 40% 30% at 80% 110%, rgba(94,207,138,0.04) 0%, transparent 60%);
  }

  /* Header */
  header {
    width: 100%;
    max-width: 680px;
    padding: 3rem 0 2.5rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 0.5px solid var(--border);
    margin-bottom: 3rem;
  }

  .logo-block { display: flex; flex-direction: column; gap: 4px; }

  .logo-wordmark {
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }

  h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  h1 span { color: var(--accent); }

  .badge {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 0.5px solid var(--border-strong);
    color: var(--text-muted);
    letter-spacing: 0.08em;
  }

  /* Main container */
  main { width: 100%; max-width: 680px; }

  /* Drop zone */
  #drop-zone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    background: var(--surface);
    margin-bottom: 2rem;
  }

  #drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
  }

  #drop-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
  }

  .drop-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--surface2);
    border: 0.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 22px;
  }

  .drop-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
  }

  .drop-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
  }

  .drop-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 1.25rem;
  }

  .format-pill {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--surface2);
    border: 0.5px solid var(--border);
    color: var(--text-muted);
    letter-spacing: 0.06em;
  }

  /* Schedule section */
  #schedule-section { display: none; }

  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }

  .section-label {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .header-actions { display: flex; gap: 8px; align-items: center; }

  .btn-ghost {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 5px 12px;
    background: none;
    border: 0.5px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: color 0.15s, border-color 0.15s;
  }

  .btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

  .btn-reset {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 5px 12px;
    background: none;
    border: 0.5px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: color 0.15s, border-color 0.15s;
  }

  .btn-reset:hover { color: var(--text-muted); border-color: var(--border-strong); }

  /* Day rows */
  #days-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 2rem; }

  .day-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 0.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
  }

  .day-row:hover { border-color: var(--border-strong); background: var(--surface2); }

  .day-row.selected {
    border-color: var(--accent-border);
    background: var(--accent-dim);
  }

  .day-row.unavailable { opacity: 0.45; }

  .checkbox {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    font-size: 11px;
    color: var(--bg);
  }

  .day-row.selected .checkbox {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1800;
  }

  .day-info { flex: 1; min-width: 0; }

  .day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .day-date {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
  }

  .tag {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 400;
  }

  .tag-vrij {
    background: var(--surface2);
    color: var(--text-dim);
    border: 0.5px solid var(--border);
  }

  .tag-vakantie {
    background: rgba(94, 207, 138, 0.1);
    color: #5ecf8a;
    border: 0.5px solid rgba(94, 207, 138, 0.25);
  }

  .tag-optie {
    background: rgba(100,140,255,0.1);
    color: #8aabff;
    border: 0.5px solid rgba(100,140,255,0.2);
  }

  .day-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: 'DM Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .day-crew {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Inline time inputs in day rows */
  .day-time {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .day-time-hidden {
    visibility: hidden;
    pointer-events: none;
  }

  .time-input {
    background: var(--surface2);
    border: 0.5px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 4px 7px;
    outline: none;
    width: 88px;
    transition: border-color 0.15s, color 0.15s;
  }

  .time-input.is-default { color: var(--text-dim); }
  .time-input:focus { border-color: var(--accent); color: var(--text); }

  .time-sep-inline {
    color: var(--text-dim);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
  }

  /* Export buttons */
  .export-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .export-btn-base {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius);
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: opacity 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  #gcal-btn {
    background: var(--accent);
    border: none;
    color: #1a1800;
  }
  #gcal-btn:hover { opacity: 0.88; }
  #gcal-btn:active { transform: scale(0.99); }
  #gcal-btn:disabled { opacity: 0.3; cursor: default; }

  #ics-btn {
    background: none;
    border: 0.5px solid var(--border-strong);
    color: var(--text-muted);
  }
  #ics-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
  #ics-btn:disabled { opacity: 0.3; cursor: default; }

  #export-note {
    text-align: center;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 12px;
    min-height: 18px;
    transition: color 0.3s;
    line-height: 1.7;
  }
  #export-note.success { color: var(--green); }

  #popup-warning {
    display: none;
    padding: 10px 14px;
    background: var(--accent-dim);
    border: 0.5px solid var(--accent-border);
    border-radius: var(--radius);
    color: var(--accent);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    margin-top: 10px;
    line-height: 1.6;
  }

  /* How-to footer strip */
  .how-to {
    display: flex;
    gap: 0;
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 3rem;
  }

  .how-step {
    flex: 1;
    padding: 14px 16px;
    border-right: 0.5px solid var(--border);
    position: relative;
  }

  .how-step:last-child { border-right: none; }

  .how-num {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
  }

  .how-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
  }

  /* Loading state */
  #loading {
    display: none;
    text-align: center;
    padding: 2rem;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: 1rem;
  }

  .spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: -3px;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  /* Error */
  #error-msg {
    display: none;
    padding: 12px 16px;
    background: var(--red-dim);
    border: 0.5px solid rgba(224,96,96,0.25);
    border-radius: var(--radius);
    color: var(--red);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    margin-bottom: 1rem;
  }

  /* Fade-in animation for rows */
  @keyframes rowIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }

  .day-row { animation: rowIn 0.25s ease both; }

  @media (max-width: 520px) {
    h1 { font-size: 22px; }
    .day-crew { display: none; }
    .how-to { flex-direction: column; }
    .how-step { border-right: none; border-bottom: 0.5px solid var(--border); }
    .how-step:last-child { border-bottom: none; }
  }