﻿  :root {
    --bg: #f5f1e9;
    --surface: #fffdf8;
    --surface2: #efe9dd;
    --border: #d6c4a1;
    --text: #1a1814;
    --muted: #5c5346;
    --accent: #6b5535;
    --accent-dim: #4f3f28;
    --ok: #2d5a42;
    --warn: #9a7b2d;
    --bad: #a3443a;
    --full: #5b4f6e;
    --tap-min: 44px;
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  /* Bar maklumat (pembungkus statik di atas iframe GAS; kelas .netlify-* kekal untuk keserasian) */
  .netlify-top-banner {
    flex-shrink: 0;
    z-index: 2;
    background: linear-gradient(180deg, var(--surface) 0%, #faf6ee 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 253, 248, 0.85) inset;
  }

  .netlify-top-banner__inner {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0.55rem max(0.75rem, env(safe-area-inset-left)) 0.6rem max(0.75rem, env(safe-area-inset-right));
    padding-top: max(0.55rem, env(safe-area-inset-top));
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .netlify-top-banner__badge {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--surface);
    background: var(--accent);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    line-height: 1.2;
  }

  .netlify-top-banner__text {
    margin: 0;
    font-size: clamp(0.78rem, 2.8vw, 0.88rem);
    line-height: 1.45;
    color: var(--muted);
  }

  .netlify-top-banner__text strong {
    color: var(--text);
    font-weight: 600;
  }

  .netlify-top-banner__hint {
    display: block;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(214, 196, 161, 0.65);
    font-size: 0.94em;
  }

  .setup-title {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 4.5vw, 1.45rem);
    letter-spacing: 0.02em;
  }

  .setup-hint code {
    font-size: 0.82em;
    word-break: break-all;
  }

  h1,
  h2,
  .cal-head h2,
  .brand-name {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  }

  .brand-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding: 1rem 0.85rem 1.15rem;
    background: var(--surface);
    border: 3px double var(--border);
    border-radius: 12px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.9) inset,
      0 0 0 1px rgba(214, 196, 161, 0.35);
  }

  .brand-header--compact {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem 0.75rem;
  }

  .brand-logo {
    display: block;
    margin: 0 auto;
    max-width: min(100%, 320px);
    width: auto;
    height: auto;
    max-height: min(200px, 32vh);
    object-fit: contain;
  }

  .brand-logo--compact {
    max-width: min(100%, 200px);
    max-height: 110px;
  }

  .brand-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0;
  }

  .brand-wordmark--compact .brand-name {
    font-size: 1.5rem;
  }

  .brand-wordmark--compact .brand-tag {
    font-size: 0.8rem;
  }

  .brand-est {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  .brand-name {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.05;
  }

  .brand-tag {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--text);
  }

  .wrap {
    width: 100%;
    max-width: min(560px, 100%);
    margin: 0 auto;
    padding: max(1rem, env(safe-area-inset-top, 0px))
      max(1rem, env(safe-area-inset-right, 0px))
      max(2rem, env(safe-area-inset-bottom, 0px))
      max(1rem, env(safe-area-inset-left, 0px));
  }

  h1 {
    font-size: clamp(1.35rem, 4.8vw, 1.55rem);
    font-weight: 600;
    margin: 0 0 0.35rem;
    letter-spacing: 0.02em;
  }

  .sub {
    color: var(--muted);
    font-size: clamp(0.9rem, 3.4vw, 1rem);
    margin-bottom: 1.25rem;
    line-height: 1.55;
  }

  .nav-top {
    text-align: right;
    margin-bottom: 0.5rem;
  }

  .nav-top a {
    color: var(--muted);
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    padding: 0.35rem 0.5rem;
    -webkit-tap-highlight-color: rgba(107, 85, 53, 0.15);
  }

  .nav-top a:hover {
    color: var(--accent);
  }

  .nav-top a:active {
    color: var(--accent-dim);
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1rem 1.1rem;
    margin-bottom: 1rem;
  }

  .cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }

  .cal-head button {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    width: var(--tap-min);
    height: var(--tap-min);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(107, 85, 53, 0.2);
  }

  .cal-head button:hover {
    background: #e4dcc8;
  }

  .cal-head button:active {
    background: #dcd3bc;
    transform: scale(0.96);
  }

  .cal-head h2 {
    margin: 0;
    font-size: clamp(1rem, 3.6vw, 1.12rem);
    font-weight: 600;
  }

  .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .day-cell {
    aspect-ratio: 1;
    max-height: 52px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--surface2);
    color: var(--text);
    font-size: clamp(0.82rem, 3.8vw, 0.9rem);
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(107, 85, 53, 0.12);
  }

  .day-cell.out {
    opacity: 0.3;
    background: transparent;
  }

  .day-cell.past {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .day-cell.available {
    cursor: pointer;
    border-color: rgba(45, 90, 66, 0.45);
    background: rgba(45, 90, 66, 0.12);
  }

  .day-cell.available:hover {
    background: rgba(45, 90, 66, 0.2);
  }

  .day-cell.available:active,
  .day-cell.full:active {
    filter: brightness(1.15);
    transform: scale(0.97);
  }

  .day-cell.full {
    cursor: pointer;
    border-color: rgba(91, 79, 110, 0.45);
    background: rgba(91, 79, 110, 0.12);
  }

  .day-cell.closed {
    cursor: not-allowed;
    border-color: rgba(163, 68, 58, 0.4);
    background: rgba(163, 68, 58, 0.1);
    opacity: 0.88;
  }

  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.85rem;
  }

  .legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }

  .dot.ok {
    background: var(--ok);
  }

  .dot.full {
    background: var(--full);
  }

  .dot.closed {
    background: var(--bad);
  }

  .dot.past {
    background: var(--muted);
  }

  .modal-back {
    position: fixed;
    inset: 0;
    background: rgba(26, 22, 18, 0.48);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
    padding: 0;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .modal-back.show {
    display: flex;
  }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    width: 100%;
    max-width: min(420px, 100vw);
    max-height: min(92dvh, 92vh);
    overflow: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1.15rem;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
    animation: up 0.2s ease;
  }

  @media (min-width: 480px) {
    .modal-back {
      padding: 1rem;
      align-items: center;
    }

    .modal {
      border-radius: 14px;
      max-height: 85vh;
      max-height: min(85dvh, 85vh);
    }
  }

  @keyframes up {
    from {
      transform: translateY(12px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .modal h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
  }

  .modal .close-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }

  .btn-text {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 0.65rem;
    margin: -0.5rem -0.35rem -0.5rem 0;
    min-height: var(--tap-min);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-text:hover {
    color: var(--text);
  }

  .btn-text:active {
    color: var(--text);
  }

  .slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 1rem;
  }

  .slot {
    padding: 0.65rem 0.4rem;
    min-height: var(--tap-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(107, 85, 53, 0.18);
  }

  .slot:hover:not(:disabled) {
    border-color: var(--accent);
  }

  .slot:active:not(:disabled) {
    border-color: var(--accent-dim);
    background: #e4dcc8;
  }

  .slot:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
  }

  label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
  }

  input[type="text"],
  input[type="tel"],
  input[type="password"],
  textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    margin-bottom: 0.65rem;
  }

  textarea {
    min-height: 64px;
    resize: vertical;
  }

  .btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 48px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fffdf8;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.25rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 253, 248, 0.2);
  }

  .btn-primary:hover:not(:disabled) {
    background: var(--accent-dim);
  }

  .btn-primary:active:not(:disabled) {
    background: var(--accent-dim);
    transform: scale(0.99);
  }

  .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .msg {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
  }

  .msg.err {
    background: rgba(163, 68, 58, 0.12);
    color: #7a2e26;
  }

  .msg.ok {
    background: rgba(45, 90, 66, 0.12);
    color: #1e4a32;
  }

  .success-id {
    font-family: ui-monospace, monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ok);
    margin: 0.5rem 0;
  }

  .loading {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem;
  }

  /* Telefon: skala teks selesa, kalendar lebar penuh, tap target lebih besar, muat skrin, elak zoom */
  @media (max-width: 480px) {
    :root {
      --tap-min: 48px;
    }

    html {
      font-size: 17px;
      overflow-x: hidden;
      /* Serta viewport user-scalable=no â€” kurangkan zoom ketik-dua */
      touch-action: manipulation;
    }

    body {
      min-height: 100vh;
      min-height: 100dvh;
      min-height: -webkit-fill-available;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
      touch-action: manipulation;
    }

    .wrap {
      max-width: 100%;
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
      padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
      padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
      padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
      padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    }

    .brand-header {
      padding: 0.85rem 0.6rem 1rem;
      margin-bottom: 1rem;
    }

    .brand-logo {
      max-width: 100%;
      max-height: min(200px, 36vh);
    }

    .brand-logo--compact {
      max-width: min(100%, 240px);
      max-height: 120px;
    }

    h1 {
      font-size: clamp(1.45rem, 5.5vw, 1.65rem);
    }

    .sub {
      font-size: 1rem;
      margin-bottom: 1.1rem;
    }

    .card {
      padding: 1rem 0.75rem 1.15rem;
      border-radius: 14px;
    }

    .cal-head {
      margin-bottom: 0.65rem;
    }

    .cal-head h2 {
      font-size: clamp(1.05rem, 4.2vw, 1.2rem);
      padding: 0 0.25rem;
      text-align: center;
    }

    .day-cell {
      max-height: none;
      aspect-ratio: 1;
      min-height: 0;
      min-width: 0;
      font-size: clamp(0.95rem, 4.2vw, 1.08rem);
      font-weight: 600;
      border-radius: 10px;
    }

    .weekdays {
      gap: 2px;
      font-size: clamp(0.65rem, 2.8vw, 0.72rem);
      margin-bottom: 6px;
    }

    .days {
      gap: 6px;
    }

    .legend {
      font-size: 0.82rem;
      gap: 0.5rem 0.85rem;
      margin-top: 1rem;
      justify-content: flex-start;
    }

    .dot {
      width: 9px;
      height: 9px;
    }

    .nav-top a {
      font-size: 0.88rem;
      padding: 0.4rem 0.35rem;
    }

    .slots {
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }

    .slot {
      font-size: 0.95rem;
      padding: 0.75rem 0.45rem;
    }

    .modal {
      max-width: 100%;
      padding: 1.25rem 1rem;
      border-radius: 16px 16px 0 0;
    }

    .modal h3 {
      font-size: 1.12rem;
    }
  }

  @media (max-width: 360px) {
    .slots {
      grid-template-columns: 1fr;
    }
  }

  @media (min-width: 481px) {
    input[type="text"],
    input[type="tel"],
    input[type="password"],
    textarea {
      font-size: 0.95rem;
    }
  }


/* --- cPanel / static host shell (nav + iframe) --- */
.cpanel-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 0.35rem 0.75rem;
  box-sizing: border-box;
  background: rgba(62, 52, 42, 0.92);
  color: #f5f1e9;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
}
.cpanel-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cpanel-chrome nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.cpanel-chrome nav a {
  color: #f5f1e9;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  opacity: 0.88;
}
.cpanel-chrome nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}
.cpanel-chrome nav a.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}
.cpanel-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}
.cpanel-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.cpanel-shell .frame-root {
  position: absolute;
  inset: 0;
  display: none;
}
.cpanel-shell .frame-root.is-on {
  display: block;
}
.cpanel-shell .frame-root iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.cpanel-shell .setup-wrap {
  flex: 1;
  overflow: auto;
}

