/* SUN Assist — identitas "sunny paper": kertas hangat, amber matahari, navy ink.
   Mobile-first, satu kolom max 520px. */

:root {
  --paper: #FFF8E7;
  --card: #FFFFFF;
  --ink: #1B2A41;
  --ink-soft: #5B6B82;
  --line: #F0E6CE;
  --sun: #F2A413;
  --sun-deep: #D98E00;
  --sun-soft: #FDEBC8;
  --leaf: #2A9D8F;
  --leaf-soft: #DCF2EF;
  --rose: #E15554;
  --rose-soft: #FBE3E3;
  --sky: #3E7CB1;
  --sky-soft: #E1EDF7;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(27, 42, 65, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
}

/* ---------- appbar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px calc(12px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--ink); color: var(--sun);
  display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-name em { font-style: normal; color: var(--sun-deep); }
.appbar-actions { display: flex; gap: 8px; align-items: center; }

.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 13px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
}
.chip svg { width: 16px; height: 16px; display: block; }
.chip-ghost { color: var(--ink-soft); }
.chip:active { transform: scale(.96); }

/* ---------- page ---------- */
.page { max-width: 520px; margin: 0 auto; padding: 20px 18px calc(48px + env(safe-area-inset-bottom)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}

h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 10px; }
.muted { color: var(--ink-soft); font-size: 14px; margin: 0; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 15px;
  border: none; border-radius: 999px; padding: 13px 22px; cursor: pointer;
  transition: transform .06s ease; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-sun { background: var(--sun); color: #fff; box-shadow: 0 4px 14px rgba(242, 164, 19, .4); }
.btn-navy { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-block { width: 100%; }

/* ---------- dev-login ---------- */
.dev-badge {
  display: inline-block; background: var(--rose-soft); color: var(--rose);
  font-weight: 800; font-size: 12px; letter-spacing: .08em;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
}
.user-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.user-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 14px 16px; font: inherit; cursor: pointer; text-align: left;
}
.user-btn:active { transform: scale(.98); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.user-btn .name { font-weight: 700; }
.user-btn .email { font-size: 13px; color: var(--ink-soft); }

/* ---------- kartu rekam ---------- */
.rec-card { text-align: center; padding: 26px 20px; }
.rec-btn {
  width: 92px; height: 92px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--sun); color: #fff; box-shadow: 0 8px 28px rgba(242, 164, 19, .45);
  display: grid; place-items: center; margin: 14px auto 10px;
  transition: transform .1s ease, background .2s;
}
.rec-btn svg { width: 38px; height: 38px; }
.rec-btn:active { transform: scale(.94); }
.rec-btn.recording { background: var(--rose); box-shadow: 0 8px 28px rgba(225, 85, 84, .45); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.rec-status { font-weight: 700; min-height: 24px; }
.rec-timer { font-variant-numeric: tabular-nums; color: var(--rose); font-weight: 800; }

.or-sep { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; margin: 18px 0 12px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.text-row { display: flex; gap: 8px; }
.input {
  flex: 1; font: inherit; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--ink); min-width: 0;
}
.input:focus { outline: 2px solid var(--sun); border-color: var(--sun); }
.send-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ink); color: #fff; display: grid; place-items: center;
}
.send-btn svg { width: 20px; height: 20px; }

/* ---------- kalender penuh (timeline modern) ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 14px;
  margin-bottom: 12px;
}
.back-link svg { width: 17px; height: 17px; }
.back-link:active { color: var(--ink); }
.cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head .chip { flex: none; }
.cal-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.cal-tabs .chip { text-decoration: none; }
.chip-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-toolbar { position: sticky; top: 62px; z-index: 30; padding: 6px 0 10px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); }

.tl-day { margin-bottom: 18px; }
.tl-day-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.tl-day-date {
  width: 46px; height: 50px; border-radius: 14px; flex: none;
  background: var(--card); border: 1.5px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.tl-day-date b { font-size: 18px; }
.tl-day-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-soft); }
.tl-today .tl-day-date { background: var(--sun); border-color: var(--sun); color: #fff; }
.tl-today .tl-day-date small { color: rgba(255, 255, 255, .85); }
.tl-day-name { font-weight: 800; font-size: 15.5px; }
.tl-today .tl-day-name { color: var(--sun-deep); }
.tl-day-count { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

.tl-events { display: flex; flex-direction: column; gap: 8px; padding-left: 12px; border-left: 2px solid var(--line); margin-left: 22px; }
.tl-event {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--cal, var(--sun));
  border-radius: 14px; padding: 11px 14px; text-decoration: none; color: var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.tl-event:active { transform: scale(.985); }
.tl-time { flex: none; width: 44px; display: flex; flex-direction: column; line-height: 1.25; }
.tl-time b { font-size: 14px; font-weight: 800; color: var(--ink); }
.tl-time small { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.tl-body { min-width: 0; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 26px; }
.section-row h2 { margin: 0; }
.section-row a { font-size: 14px; font-weight: 700; color: var(--sky); text-decoration: none; white-space: nowrap; }

/* ubin aksi cepat di bawah kartu rekam */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.quick-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow); transition: transform .08s ease;
}
.quick-tile:active { transform: scale(.97); }
.quick-tile b { font-size: 14.5px; font-weight: 800; }
.quick-tile small { color: var(--ink-soft); font-size: 12.5px; }
.quick-ic {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 8px;
}
.quick-ic svg { width: 19px; height: 19px; }

/* ---------- banner koneksi ---------- */
.banner {
  display: flex; gap: 14px; align-items: center;
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  text-decoration: none; color: var(--ink); border: 1.5px dashed;
}
.banner .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.banner .ic svg { width: 21px; height: 21px; }
.banner b { display: block; }
.banner small { color: var(--ink-soft); }
.banner-cal { background: var(--sky-soft); border-color: var(--sky); }
.banner-cal .ic { background: var(--sky); color: #fff; }
.banner-tg { background: var(--leaf-soft); border-color: var(--leaf); }
.banner-tg .ic { background: var(--leaf); color: #fff; }

/* ---------- agenda ---------- */
.day-label {
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sun-deep); margin: 22px 0 8px;
}
.event {
  display: flex; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; margin-bottom: 8px;
  text-decoration: none; color: var(--ink);
}
.event-time { flex: none; width: 52px; font-weight: 800; font-size: 14px; color: var(--sky); }
.event-title { font-weight: 700; font-size: 15px; }
.event-loc { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.event-loc svg { width: 13px; height: 13px; }
.empty {
  text-align: center; color: var(--ink-soft); padding: 30px 16px;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.agenda-loading { animation: fade-pulse 1.2s ease-in-out infinite; }
@keyframes fade-pulse { 50% { opacity: .45; } }

/* label asal kalender — baris kecil di bawah judul event */
.cal-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.cal-owner {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
  margin-top: 2px; min-width: 0;
}
.cal-owner .cal-dot { margin-top: 0; }

/* halaman pilih kalender — satu kalender per baris */
.cal-pick-list { display: block; margin-top: 14px; max-height: 55vh; overflow-y: auto; }
.cal-pick {
  display: flex; align-items: center; gap: 12px; cursor: pointer; width: 100%;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 8px;
}
.cal-pick input { width: 18px; height: 18px; accent-color: var(--sun); flex: none; }
.cal-pick .cal-dot { flex: none; }
.cal-pick-name {
  font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0;
  overflow-wrap: anywhere;
}
.cal-pick-name small { display: block; font-weight: 600; color: var(--ink-soft); }
.cal-pick-locked { opacity: .85; background: var(--sun-soft); border-color: var(--sun); }

/* ---------- wizard ---------- */
.btn-google {
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); box-shadow: var(--shadow);
}
.btn-google svg { width: 20px; height: 20px; }
.manual-details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.manual-details summary {
  cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink-soft);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.manual-details summary::before { content: '▸'; transition: transform .15s; }
.manual-details[open] summary::before { transform: rotate(90deg); }

.step { display: flex; gap: 14px; margin-bottom: 18px; }
.step-no {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--sun-soft); color: var(--sun-deep);
  font-weight: 800; display: grid; place-items: center; font-size: 14px;
}
.step-body { min-width: 0; }
.step-body b { display: block; margin-bottom: 3px; }
.step-body p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.copy-box {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
.copy-box code { font-size: 12.5px; word-break: break-all; flex: 1; }
.copy-box button { flex: none; }
.ok-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--leaf-soft); color: var(--leaf); font-weight: 800; font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
}
.ok-badge svg { width: 15px; height: 15px; }

label.field-label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
.input-block { width: 100%; border-radius: 14px; }

/* ---------- pratinjau capture (bottom sheet) ---------- */
#sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(27, 42, 65, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 520px;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  animation: slide-up .22s ease;
}
@keyframes slide-up { from { transform: translateY(40%); opacity: .4; } }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet h3 { margin: 0 0 2px; font-size: 19px; font-weight: 800; }
.sheet-row { display: flex; gap: 9px; align-items: flex-start; margin-top: 9px; font-size: 14.5px; }
.sheet-row svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--sun-deep); }
.sheet-transcript {
  margin-top: 14px; background: var(--paper); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; color: var(--ink-soft); font-style: italic;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }
.sheet-answer {
  white-space: pre-line; font-size: 14.5px; line-height: 1.6;
  max-height: 55vh; overflow-y: auto;
}

/* ---------- toast & dialog ---------- */
#toast-wrap {
  position: fixed; left: 0; right: 0; z-index: 80;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 18px;
}
.toast {
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14.5px;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); transition: all .28s ease;
  max-width: 100%;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--rose); }

#dialog-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(27, 42, 65, .5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dialog {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; width: 100%; max-width: 360px;
}
.dialog p { margin: 0 0 18px; font-weight: 600; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- meeting assistant ---------- */
.banner-mt { background: var(--sun-soft); border-color: var(--sun-deep); border-style: solid; margin-top: 16px; }
.banner-mt .ic { background: var(--sun-deep); color: #fff; }
.mt-blink { animation: fade-pulse 1s ease-in-out infinite; }
.mt-bar { height: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.mt-fill { height: 100%; background: linear-gradient(90deg, var(--sun), var(--sun-deep)); border-radius: 999px; transition: width .6s ease; }
.mt-list { margin: 0; padding-left: 20px; }
.mt-list li { margin-bottom: 6px; }
.mt-actions { display: flex; flex-direction: column; gap: 8px; }
.mt-action {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--leaf-soft); border: 1px solid var(--leaf); border-radius: 12px; padding: 10px 13px;
}
.mt-action svg { width: 17px; height: 17px; flex: none; color: var(--leaf); margin-top: 2px; }
.mt-action small { display: block; color: var(--ink-soft); font-weight: 600; }
.mt-transcript { white-space: pre-line; font-size: 14px; color: var(--ink-soft); max-height: 50vh; overflow-y: auto; margin: 12px 0 0; }
select.input { appearance: auto; }

.stats-strip {
  display: flex; gap: 20px; align-items: baseline;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 18px; margin-bottom: 14px; font-size: 14px; color: var(--ink-soft);
}
.stats-strip b { font-size: 19px; color: var(--ink); }
.stats-strip small { font-weight: 700; }

.qa-q {
  background: var(--sun-soft); border-radius: 14px 14px 4px 14px;
  padding: 9px 14px; margin: 10px 0 6px auto; max-width: 85%; width: fit-content;
  font-weight: 600; font-size: 14.5px;
}
.qa-a {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 9px 14px; max-width: 92%; width: fit-content;
  font-size: 14.5px; white-space: pre-line;
}

/* layar lebar: sedikit lega */
@media (min-width: 560px) {
  .page { padding-top: 30px; }
}
