/* MJ Planner: dark, phone-first, MJ Method look (black + chrome silver, red accent from house_style RED). */
@font-face { font-family: "Poppins XB"; src: url("/fonts/Poppins-ExtraBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Montserrat SB"; src: url("/fonts/Montserrat-SemiBold.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #000;
  --panel: #111214;
  --panel-2: #1a1c1f;
  --line: #2a2d31;
  --text: #ececec;
  --muted: #9a9ea4;
  --silver: #c9ccd1;
  --red: #e2232a;
  --green: #22a04e;
  --yellow: #face15;
  --blue: #4c8dff;
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Montserrat SB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, .xb { font-family: "Poppins XB", system-ui, sans-serif; letter-spacing: .01em; }
a { color: var(--silver); }
button { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: rgba(0,0,0,.92);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.logo { height: 30px; width: auto; }
.top-title { flex: 1; font-family: "Poppins XB", sans-serif; font-size: 17px; color: var(--silver);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  min-width: 40px; height: 40px; font-size: 18px; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #050505; border-top: 1px solid var(--line);
}
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: 12px; gap: 2px; }
.bottom a span { font-size: 22px; }
.bottom a.on { color: var(--text); }
.bottom a.on span { filter: drop-shadow(0 0 6px rgba(226,35,42,.7)); }

.h-day { font-size: 22px; margin: 4px 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
.card.today { border-color: rgba(226,35,42,.6); }
.sess-head { display: flex; align-items: flex-start; gap: 10px; }
.sess-icon { font-size: 26px; line-height: 1; }
.sess-title { font-family: "Poppins XB", sans-serif; font-size: 18px; margin: 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--silver); white-space: nowrap; }
.pill.red { background: rgba(226,35,42,.15); border-color: rgba(226,35,42,.5); color: #ff8a8e; }
.pill.green { background: rgba(34,160,78,.15); border-color: rgba(34,160,78,.5); color: #7fe0a2; }
.pill.yellow { background: rgba(250,206,21,.12); border-color: rgba(250,206,21,.45); color: var(--yellow); }
.pill.blue { background: rgba(76,141,255,.12); border-color: rgba(76,141,255,.45); color: #9cc0ff; }
.brief { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; color: var(--silver); font-size: 14px; }

.items { list-style: none; margin: 12px 0 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.tick {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; border: 2px solid #3a3e44; background: #0b0c0d;
  font-size: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  touch-action: manipulation;
}
.tick.on { background: var(--green); border-color: var(--green); }
.tick:disabled { opacity: .45; cursor: default; }
.item-main { flex: 1; min-width: 0; }
.item-code { font-family: "Poppins XB", sans-serif; color: var(--silver); font-size: 13px; }
.item-what { font-size: 15px; overflow-wrap: anywhere; }
.item-open { flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; text-decoration: none; color: var(--text); }
.big-tick { width: 100%; margin-top: 12px; padding: 14px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font-family: "Poppins XB", sans-serif; font-size: 16px; }
.big-tick.on { background: var(--green); }
.big-tick:disabled { opacity: .5; }

/* calendar */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: #2b2e33; color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.day { margin: 0 0 14px; }
.day h3 { font-size: 15px; margin: 0 0 6px; color: var(--silver); }
.day.is-today h3 { color: #ff8a8e; }
.vid { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; margin: 0 0 8px; text-decoration: none; color: var(--text); }
.vid-time { font-family: "Poppins XB", sans-serif; font-size: 13px; color: var(--silver); min-width: 46px; padding-top: 2px; }
.vid-main { flex: 1; min-width: 0; }
.vid-title { font-size: 15px; overflow-wrap: anywhere; }
.vid-meta { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.mcell { min-height: 58px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px;
  font-size: 12px; cursor: pointer; text-align: left; color: var(--text); }
.mcell.out { opacity: .35; }
.mcell.is-today { border-color: var(--red); }
.mcell .dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.s-nak-rakam { background: #6b7076; } .s-raw-masuk { background: var(--blue); } .s-edit { background: var(--yellow); }
.s-review { background: #ff9f43; } .s-approved { background: var(--green); } .s-posted { background: #c084fc; }

/* reader */
.reader-head { margin: 4px 0 10px; }
.reader-head h1 { font-size: 22px; margin: 6px 0; line-height: 1.2; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer;
  text-decoration: none; color: var(--text); font-size: 14px; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; font-family: "Poppins XB", sans-serif; }
.md { font-size: 17px; }
.md h3 { font-size: 17px; margin: 18px 0 6px; color: var(--silver); }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 22px; margin: 6px 0; }
.md li { margin: 4px 0; }
.md blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--red); background: var(--panel); border-radius: 0 10px 10px 0; }
.md code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.script-lines { background: #0b0c0d; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.script-lines div { padding: 5px 0; border-bottom: 1px dashed #24272b; font-size: 19px; line-height: 1.35; }
.script-lines div:last-child { border-bottom: 0; }
.sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.sec-label { font-family: "Poppins XB", sans-serif; font-size: 13px; color: var(--silver); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.sec.dont { border-color: rgba(226,35,42,.55); background: rgba(226,35,42,.08); }
.sec.dont .sec-label { color: #ff8a8e; }
.sec.product .sec-label { color: var(--yellow); }
.sec.hook .sec-label { color: #fff; }
.mine-badge { color: var(--yellow); }

/* record mode */
.rakam { position: fixed; inset: 0; z-index: 20; background: #000; overflow-y: auto; padding: calc(12px + env(safe-area-inset-top)) 18px 120px; }
.rakam .md { font-size: 26px; line-height: 1.35; }
.rakam .script-lines div { font-size: 30px; padding: 10px 0; }
.rakam .sec { font-size: 22px; }
.rakam-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; display: flex; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.94); border-top: 1px solid var(--line); }
.rakam-bar .btn { flex: 1; text-align: center; padding: 14px 6px; font-size: 16px; }
.rakam-title { font-family: "Poppins XB", sans-serif; font-size: 20px; color: var(--silver); margin: 0 0 6px; }
.rakam-sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* write */
textarea.write { width: 100%; min-height: 55vh; background: #0b0c0d; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font: 17px/1.45 "Montserrat SB", system-ui, sans-serif; resize: vertical; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1f2226; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 12px; z-index: 30;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
@media (min-width: 700px) { .h-day { font-size: 26px; } }
/* helpers (the page's CSP forbids inline style attributes) */
.dot.inl { display: inline-block; margin-right: 5px; vertical-align: middle; }
.grow { flex: 1; min-width: 0; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt14 { margin-top: 14px; }
.btn.block { display: block; text-align: center; margin-top: 10px; text-decoration: none; }
.dim { opacity: .4; pointer-events: none; }
.mh { margin: 6px 0 8px; }
/* review + voice */
.bottom a { position: relative; }
.badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.player { margin-top: 10px; }
.player video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.small-player { margin: 0; }
.small-player video { max-height: 40vh; }
pre.caption { white-space: pre-wrap; background: #0b0c0d; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 14px/1.4 "Montserrat SB", sans-serif; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; font-family: "Poppins XB", sans-serif; }
textarea.write.short { min-height: 120px; margin-top: 10px; }
.sec.voice { text-align: center; }
.mic { width: 88px; height: 88px; border-radius: 50%; border: 3px solid #3a3e44; background: #0b0c0d; font-size: 38px; cursor: pointer; margin: 6px auto; display: block; }
.mic.on { background: var(--red); border-color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(226,35,42,.25); } }
.mic-state { font-size: 15px; color: var(--silver); margin-bottom: 8px; }
.take { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); text-align: left; }
.take audio, #micPreview audio { width: 100%; }
.rakam .sec.voice { font-size: 16px; }
