:root {
  --bg: #070708;
  --panel: rgba(18, 18, 21, .88);
  --panel-strong: #131316;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f7f7f8;
  --muted: #92929d;
  --soft: #c7c7ce;
  --accent: #ff3d51;
  --accent-2: #ff794d;
  --success: #3ee6a5;
  --radius: 22px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(255, 61, 81, .16), transparent 31rem),
    radial-gradient(circle at 86% 12%, rgba(255, 121, 77, .08), transparent 27rem),
    var(--bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
}
.ambient-one { top: 35%; left: -22rem; background: var(--accent); }
.ambient-two { right: -24rem; bottom: 0; background: var(--accent-2); }

.topbar {
  width: min(1520px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  font: 700 15px/1 var(--font-display);
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), #b80f30);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 10px 30px rgba(255, 61, 81, .24), inset 0 1px rgba(255, 255, 255, .22);
}

.brand-logo-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 38px;
  padding: 2px 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 9px;
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 61, 81, .18), transparent 58%),
    linear-gradient(145deg, rgba(29, 29, 33, .95), rgba(10, 10, 12, .96));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .05);
}

.brand-logo-shell::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -25px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 61, 81, .28);
  filter: blur(19px);
  pointer-events: none;
}

.brand-logo-shell img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font: 700 13px/1.1 var(--font-display); letter-spacing: .16em; }
.brand-copy small { color: var(--muted); font-size: 11px; }

.topbar-primary { display: flex; align-items: center; gap: 11px; }
.topbar-primary .history-toggle {
  position: relative;
  width: 52px;
  min-height: 46px;
  padding: 0 6px;
  justify-content: center;
  border-color: rgba(255, 61, 81, .4);
  color: #fff;
  background: linear-gradient(145deg, rgba(255,61,81,.14), rgba(255,255,255,.035));
  box-shadow: 0 9px 24px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.06);
}
.topbar-primary .history-toggle:hover,
.topbar-primary .history-toggle[aria-expanded="true"] { border-color: rgba(255,61,81,.72); background: rgba(255,61,81,.16); }
.topbar-primary .history-toggle svg { width: 21px; height: 21px; stroke-width: 2.15; }
.topbar-primary .history-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border: 2px solid var(--bg); background: #b71f36; }
.topbar-primary .history-toggle > span { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.plan-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 7px 11px; border: 1px solid rgba(62, 230, 165, .2); border-radius: 11px; background: rgba(62, 230, 165, .045); }
.plan-status small { color: var(--success); font: 700 8px/1 var(--font-display); letter-spacing: .14em; }
.plan-status strong { color: var(--text); font: 700 10px/1.2 var(--font-display); white-space: nowrap; }
.logout-form { margin: 0; }
.logout-button { min-height: 42px; padding: 0 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; font-weight: 700; }
.logout-button:hover { color: var(--text); border-color: var(--line-strong); }

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .025);
  font-size: 12px;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #f4b13e; box-shadow: 0 0 10px #f4b13e; }
.status-dot.is-ready { background: var(--success); box-shadow: 0 0 10px var(--success); }

.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(255, 61, 81, .3);
  border-radius: 13px;
  color: var(--text);
  background: linear-gradient(120deg, rgba(255, 61, 81, .11), rgba(255, 255, 255, .035));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
  text-decoration: none;
  transition: transform .18s, border-color .18s, background .18s;
}

.contact-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 61, 81, .62);
  background: linear-gradient(120deg, rgba(255, 61, 81, .19), rgba(255, 255, 255, .055));
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #ff5364, #d7193b);
  box-shadow: 0 8px 20px rgba(255, 61, 81, .2);
}

.contact-icon img { display: block; width: 18px; height: 18px; object-fit: contain; }

.contact-copy { display: flex; flex-direction: column; gap: 1px; }
.contact-copy small { color: var(--muted); font-size: 9px; }
.contact-copy strong { font: 600 11px/1.2 var(--font-display); }
.contact-button b { color: var(--accent); font-size: 14px; }

.app-shell { width: min(1520px, calc(100% - 48px)); margin: 0 auto; padding: 72px 0 42px; }

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  margin-bottom: 36px;
}

.eyebrow, .section-kicker {
  color: var(--accent);
  font: 700 10px/1 var(--font-display);
  letter-spacing: .18em;
}

.intro-panel h1 {
  max-width: 780px;
  margin: 14px 0 14px;
  font: 600 clamp(43px, 5.3vw, 80px)/.98 var(--font-display);
  letter-spacing: -.055em;
}

.intro-panel h1 em {
  color: transparent;
  background: linear-gradient(100deg, #fff 8%, #9b9ba5 96%);
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
}

.intro-panel p { max-width: 590px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.flow-steps {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .02);
}

.flow-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #686872;
  font-size: 11px;
  white-space: nowrap;
}
.flow-steps li span { font: 600 9px/1 var(--font-display); }
.flow-steps li.is-active { color: var(--text); background: #222227; }

.workspace-grid { display: grid; grid-template-columns: minmax(440px, .84fr) minmax(520px, 1.16fr); gap: 20px; align-items: start; }

.builder-card, .preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(22, 22, 25, .96), rgba(13, 13, 15, .92));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .025);
}

.builder-card { padding: 28px; }
.preview-card { position: sticky; top: 18px; padding: 22px; }

.section-heading, .preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h2, .preview-toolbar h2 { margin: 6px 0 0; font: 600 24px/1.1 var(--font-display); letter-spacing: -.03em; }
.required-note { color: var(--muted); font-size: 11px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field span, .template-group legend { color: var(--soft); font-size: 12px; font-weight: 600; }

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, .028);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field input::placeholder { color: #585861; }
.field input:hover { border-color: var(--line-strong); }
.field input:focus { border-color: rgba(255, 61, 81, .78); background: rgba(255, 255, 255, .045); box-shadow: 0 0 0 3px rgba(255, 61, 81, .1); }
.field input:user-invalid { border-color: rgba(255, 61, 81, .65); }

.template-group { margin: 25px 0 0; padding: 0; border: 0; }
.template-group legend { margin-bottom: 11px; }
.template-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.template-option {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  transition: border-color .18s, background .18s, transform .18s;
}
.template-option:hover { transform: translateY(-1px); border-color: var(--line-strong); background: rgba(255, 255, 255, .035); }
.template-option:has(input:checked) { border-color: rgba(255, 61, 81, .58); background: rgba(255, 61, 81, .055); box-shadow: inset 0 0 0 1px rgba(255, 61, 81, .08); }
.template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-option b { display: none; position: absolute; right: 8px; top: 8px; padding: 4px 7px; border-radius: 999px; color: #ffdbe0; background: rgba(255, 61, 81, .18); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.template-option:has(input:checked) b { display: block; }

.template-visual {
  position: relative;
  display: block;
  width: 74px;
  height: 66px;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: #1a1a1e;
}
.template-visual::before { content: ""; position: absolute; inset: 7px 8px auto; height: 5px; border-radius: 9px; background: #efefef; opacity: .82; }
.template-visual i { position: absolute; display: block; border-radius: 4px; }
.template-visual i:nth-child(1) { top: 18px; left: 8px; right: 8px; height: 20px; background: linear-gradient(135deg, #323239, #55555f); }
.template-visual i:nth-child(2) { left: 8px; bottom: 7px; width: 26px; height: 14px; background: var(--accent); }
.template-visual i:nth-child(3) { right: 8px; bottom: 7px; width: 25px; height: 14px; background: #34343a; }
.amp-one { background: linear-gradient(145deg, #070b0d, #102f35); }
.amp-one i:nth-child(1) { background: linear-gradient(135deg, #052e36, #e12842); }
.amp-one i:nth-child(2) { background: #00d9ff; }
.amp-two { background: linear-gradient(145deg, #050505, #242424); }
.amp-two i:nth-child(1) { background: linear-gradient(135deg, #111, #aaa); }
.amp-two i:nth-child(2) { background: #f4f4f4; }
.lp-visual { width: 100%; max-width: 74px; background: linear-gradient(145deg, #181b20, #251017); }
.lp-two { background: linear-gradient(145deg, #fff7e8, #e6b8aa); }
.lp-two::before { background: #5f0b12; }
.lp-two i:nth-child(1) { background: linear-gradient(135deg, #8f0814, #d4af37); }
.lp-two i:nth-child(2) { background: #d4af37; }
.lp-two i:nth-child(3) { background: #5f0b12; }

.template-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.template-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px/1.2 var(--font-display); }
.template-meta small { color: var(--muted); font-size: 10px; }

.form-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 11px; margin-top: 27px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 51px;
  padding: 0 17px;
  cursor: pointer;
  border-radius: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s, border-color .18s, filter .18s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.button-secondary { color: var(--text); border: 1px solid var(--line-strong); background: #1a1a1e; }
.button-primary { justify-content: space-between; color: #fff; border: 1px solid rgba(255, 255, 255, .15); background: linear-gradient(115deg, #d7193b, var(--accent), var(--accent-2)); box-shadow: 0 15px 28px rgba(255, 61, 81, .18); }
.button-primary i { font-style: normal; font-size: 19px; }
.button-icon { font-size: 18px; }

.viewport-switch { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #0e0e10; }
.viewport-switch button { padding: 7px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.viewport-switch button.is-active { color: var(--text); background: #28282d; }

.preview-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.preview-tabs button { position: relative; padding: 9px 13px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.preview-tabs button::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0; height: 2px; border-radius: 2px; background: transparent; }
.preview-tabs button.is-active { color: var(--text); }
.preview-tabs button.is-active::after { background: var(--accent); }

.browser-frame {
  position: relative;
  height: 670px;
  padding-top: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #eee;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
  transition: width .25s, margin .25s;
}
.browser-frame.is-mobile { width: 390px; max-width: 100%; margin: 0 auto; }
.browser-bar { position: absolute; z-index: 2; top: 0; left: 0; width: 100%; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #1c1c20; }
.browser-bar span { width: 7px; height: 7px; border-radius: 50%; background: #46464d; }
.browser-bar span:first-child { background: #ff5364; }
.browser-bar p { display: none; }

.browser-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.browser-frame.is-empty iframe { display: none; }
.preview-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; color: #17171a; text-align: center; background: radial-gradient(circle at 50% 38%, #fff 0, #f2f2f4 55%, #e8e8eb 100%); }
.browser-frame:not(.is-empty) .preview-empty { display: none; }
.preview-empty .empty-mark { width: 58px; height: 58px; margin-bottom: 18px; }
.preview-empty .empty-mark-image {
  width: 68px;
  height: 68px;
  padding: 3px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #0d1118, #071e31);
  border-color: rgba(34, 176, 255, .42);
  box-shadow: 0 14px 34px rgba(0, 100, 180, .22), inset 0 1px rgba(255, 255, 255, .22);
}
.preview-empty .empty-mark-image img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.preview-empty h3 { margin: 0 0 7px; font: 600 20px/1.2 var(--font-display); }
.preview-empty p { max-width: 310px; margin: 0 0 17px; color: #717179; font-size: 12px; line-height: 1.5; }
.preview-empty button { padding: 9px 13px; border: 1px solid #d4d4d8; border-radius: 9px; color: #202024; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; box-shadow: 0 7px 22px rgba(0, 0, 0, .06); }

.build-progress { margin-top: 17px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .025); }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.progress-copy strong { color: var(--text); }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #29292e; }
.progress-track i { display: block; width: 10%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); transition: width .35s ease; }

.result-panel { margin-top: 17px; padding: 15px; border: 1px solid rgba(62, 230, 165, .22); border-radius: 15px; background: rgba(62, 230, 165, .045); }
.result-success { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.result-success > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #07130e; background: var(--success); font-weight: 900; }
.result-success div { display: flex; flex-direction: column; gap: 2px; }
.result-success strong { font: 600 13px/1.2 var(--font-display); }
.result-success small { color: #8faaa0; font-size: 10px; }
.result-warning { margin: 0 0 12px; padding: 9px 11px; border-radius: 9px; color: #e4c38d; background: rgba(244, 177, 62, .09); font-size: 10px; line-height: 1.45; }
.result-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.download-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 56px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #151518; text-decoration: none; transition: border-color .18s, transform .18s; }
.download-card:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.download-card > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: #ffd9de; background: rgba(255, 61, 81, .12); font: 700 9px/1 var(--font-display); }
.download-card div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.download-card strong, .download-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-card strong { font-size: 10px; }
.download-card small { color: var(--muted); font-size: 9px; }
.download-card b { color: var(--accent); }

/* ---- Halaman hasil (result.php) ---- */
.result-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0; }
.result-meta div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #151518; }
.result-meta dt { margin-bottom: 6px; color: var(--muted); font: 700 8px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.result-meta dd { margin: 0; color: var(--text); font-size: 12px; word-break: break-word; }
.result-meta dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: -.01em; }
.result-share { margin-top: 18px; }
.result-share label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #121214; font-size: 12px; }
.share-row .button { min-height: 44px; padding: 0 16px; }
.result-delete-form { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.result-delete-button { min-height: 38px; padding: 0 12px; cursor: pointer; border: 1px solid rgba(255,61,81,.24); border-radius: 10px; color: #d99ca4; background: rgba(255,61,81,.045); font-size: 10px; font-weight: 700; transition: color .16s, border-color .16s, background .16s; }
.result-delete-button:hover { color: #ffc3ca; border-color: rgba(255,61,81,.48); background: rgba(255,61,81,.09); }
.result-delete-form small { color: var(--muted); font-size: 9px; line-height: 1.4; }
@media (max-width: 520px) { .result-meta { grid-template-columns: 1fr; } }

/* Riwayat build ala workspace AI */
.history-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 11px; color: var(--soft); background: rgba(255,255,255,.025); font-size: 11px; font-weight: 700; transition: border-color .18s, color .18s, background .18s; }
.history-toggle:hover, .history-toggle[aria-expanded="true"] { color: #fff; border-color: rgba(255,61,81,.42); background: rgba(255,61,81,.08); }
.history-count { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; color: #ffdce1; background: rgba(255,61,81,.16); font: 700 8px/1 var(--font-display); }
.history-backdrop { position: fixed; inset: 0; z-index: 78; background: rgba(3,3,5,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.history-drawer { position: fixed; z-index: 80; inset: 0 auto 0 0; display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); padding: 16px; transform: translateX(-104%); border-right: 1px solid var(--line-strong); background: linear-gradient(160deg, rgba(20,20,24,.995), rgba(8,8,10,.995)); box-shadow: 30px 0 90px rgba(0,0,0,.48); transition: transform .26s cubic-bezier(.2,.75,.25,1); }
.history-drawer.is-open { transform: translateX(0); }
.history-open { overflow: hidden; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 5px 3px 15px; border-bottom: 1px solid var(--line); }
.history-head-copy { display: flex; flex-direction: column; gap: 3px; }
.history-head-copy strong { font: 600 17px/1.15 var(--font-display); }
.history-head-copy small { color: var(--muted); font-size: 10px; }
.history-close { display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.025); }
.history-close:hover { color: #fff; border-color: var(--line-strong); }
.history-new { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 14px 0 10px; border: 1px solid rgba(255,61,81,.36); border-radius: 12px; color: #fff; background: linear-gradient(120deg, rgba(215,25,59,.28), rgba(255,61,81,.1)); text-decoration: none; font-size: 11px; font-weight: 700; }
.history-new:hover { border-color: rgba(255,61,81,.65); }
.history-search-wrap { margin-bottom: 8px; }
.history-search { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: #fff; background: rgba(255,255,255,.025); font-size: 11px; }
.history-search:focus { border-color: rgba(255,61,81,.58); box-shadow: 0 0 0 3px rgba(255,61,81,.08); }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 18px; scrollbar-width: thin; scrollbar-color: #3b3b42 transparent; }
.history-group-label { display: block; padding: 15px 9px 7px; color: #666671; font: 700 8px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.history-entry { display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: center; gap: 4px; margin-bottom: 4px; }
.history-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; margin-bottom: 4px; padding: 8px; border: 1px solid transparent; border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .16s, background .16s, transform .16s; }
.history-entry .history-item { margin-bottom: 0; }
.history-delete-form { margin: 0; }
.history-delete { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; cursor: pointer; opacity: .58; border: 1px solid transparent; border-radius: 9px; color: #9a7b80; background: transparent; font: 500 17px/1 var(--font-display); transition: opacity .16s, color .16s, border-color .16s, background .16s; }
.history-entry:hover .history-delete, .history-delete:focus-visible { opacity: 1; }
.history-delete:hover { color: #ffb6c0; border-color: rgba(255,61,81,.26); background: rgba(255,61,81,.075); }
.history-item:hover { transform: translateX(2px); border-color: var(--line); background: rgba(255,255,255,.035); }
.history-item.is-active { border-color: rgba(255,61,81,.28); background: rgba(255,61,81,.075); }
.history-item-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #ffdce1; background: linear-gradient(145deg, rgba(255,61,81,.24), rgba(115,15,34,.3)); font: 700 12px/1 var(--font-display); }
.history-item-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.history-item-brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px/1.2 var(--font-display); }
.history-item-meta { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.history-item-ai { padding: 4px 5px; border-radius: 6px; color: var(--success); background: rgba(62,230,165,.08); font: 700 7px/1 var(--font-display); letter-spacing: .06em; }
.history-empty { display: flex; flex-direction: column; align-items: center; padding: 70px 24px; color: var(--muted); text-align: center; }
.history-empty-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: rgba(255,255,255,.025); font-size: 18px; }
.history-empty strong { margin-bottom: 7px; color: var(--soft); font-size: 12px; }
.history-empty p { margin: 0; font-size: 10px; line-height: 1.55; }
.history-no-result { padding: 45px 16px; color: var(--muted); text-align: center; font-size: 10px; }
.history-account-menu { display: grid; gap: 6px; flex: 0 0 auto; padding: 12px 2px 1px; border-top: 1px solid var(--line); }
.history-account-card { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 10px; padding: 3px 8px 9px; }
.history-account-avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,61,81,.28); border-radius: 11px; color: #ffdce1; background: linear-gradient(145deg, rgba(255,61,81,.22), rgba(115,15,34,.22)); font: 700 12px/1 var(--font-display); }
.history-account-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.history-account-copy strong { overflow: hidden; color: var(--text); font: 600 11px/1.2 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.history-account-copy small { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.history-menu-form { margin: 0; }
.history-menu-action { width: 100%; min-height: 48px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; cursor: pointer; border: 1px solid transparent; border-radius: 11px; color: var(--soft); background: transparent; text-align: left; text-decoration: none; transition: color .16s, border-color .16s, background .16s; }
.history-menu-action:hover { color: #fff; border-color: var(--line); background: rgba(255,255,255,.035); }
.history-menu-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; color: #dddde3; background: rgba(255,255,255,.035); font: 700 10px/1 var(--font-display); }
.history-menu-telegram { border-color: rgba(34,158,217,.28); background: rgba(34,158,217,.08); }
.history-menu-telegram img { display: block; width: 16px; height: 16px; }
.history-menu-action > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.history-menu-action strong { font: 600 10px/1.2 var(--font-display); }
.history-menu-action small { color: var(--muted); font-size: 8px; }
.history-menu-action b { color: #666671; font-size: 11px; }
.history-menu-logout { font: inherit; }
.history-menu-logout:hover { color: #ffbec6; border-color: rgba(255,61,81,.25); background: rgba(255,61,81,.055); }
.lock-history { width: 100%; min-height: 43px; margin-top: 10px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.035); font-size: 11px; font-weight: 700; }

.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: min(380px, calc(100% - 44px)); padding: 12px 15px; opacity: 0; transform: translateY(12px); pointer-events: none; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: #1b1b1f; box-shadow: 0 16px 44px rgba(0, 0, 0, .4); font-size: 12px; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: rgba(255, 61, 81, .55); }

.site-footer { width: min(1520px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 30px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #5f5f68; font-size: 11px; }
.site-footer nav { display: flex; align-items: center; gap: 18px; }
.site-footer a { color: #8d8d96; text-decoration: none; transition: color .18s; }
.site-footer a:hover { color: var(--text); }

/* Home */
.home-page { background: radial-gradient(circle at 50% 0, rgba(0, 170, 255, .1), transparent 34rem), radial-gradient(circle at 10% 25%, rgba(255, 61, 81, .12), transparent 28rem), var(--bg); }
.home-topbar { max-width: 1280px; }
.home-nav { display: flex; align-items: center; gap: 9px; }
.home-user { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.nav-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border-radius: 11px; color: var(--text); text-decoration: none; font-size: 11px; font-weight: 700; }
button.nav-button { cursor: pointer; }
.nav-button-muted { border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.nav-button-primary { border: 1px solid rgba(255,61,81,.4); background: linear-gradient(120deg, #d7193b, var(--accent)); box-shadow: 0 10px 25px rgba(255,61,81,.15); }
.home-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.home-hero { display: flex; flex-direction: column; align-items: center; min-height: 710px; padding: 75px 0 85px; text-align: center; }
.home-hero-logo { width: clamp(150px, 17vw, 220px); aspect-ratio: 1; margin: 22px 0 24px; overflow: hidden; border: 1px solid rgba(0,190,255,.42); border-radius: 50%; background: #06080b; box-shadow: 0 0 0 8px rgba(0,180,255,.035), 0 25px 80px rgba(0,150,255,.2); }
.home-hero-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-hero h1 { max-width: 980px; margin: 0; font: 600 clamp(45px, 6vw, 84px)/.98 var(--font-display); letter-spacing: -.06em; }
.home-hero h1 em { color: transparent; background: linear-gradient(100deg, #fff 15%, #56caff 55%, #9b9ba5); -webkit-background-clip: text; background-clip: text; font-style: normal; }
.home-hero > p { max-width: 700px; margin: 25px auto 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.home-cta { display: flex; justify-content: center; gap: 11px; margin-top: 31px; }
.home-primary-cta, .home-secondary-cta { display: inline-flex; align-items: center; justify-content: center; gap: 30px; min-height: 51px; padding: 0 19px; border-radius: 13px; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }
.home-primary-cta { border: 1px solid rgba(255,255,255,.15); background: linear-gradient(115deg, #d7193b, var(--accent), var(--accent-2)); box-shadow: 0 15px 35px rgba(255,61,81,.18); }
.home-secondary-cta { border: 1px solid var(--line-strong); background: rgba(255,255,255,.035); }
.tools-section { padding: 85px 0 110px; border-top: 1px solid var(--line); }
.tools-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.tools-heading h2 { margin: 8px 0 0; font: 600 clamp(30px, 4vw, 48px)/1 var(--font-display); letter-spacing: -.045em; }
.tools-heading > p { max-width: 340px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.tool-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 23px; padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, rgba(22,22,25,.96), rgba(10,10,12,.92)); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.tool-card-featured { border-color: rgba(255,61,81,.22); }
.tool-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #ff5364, #981128); box-shadow: 0 14px 32px rgba(255,61,81,.2); font: 700 17px/1 var(--font-display); }
.tool-content > span { color: var(--accent); font: 700 8px/1 var(--font-display); letter-spacing: .16em; }
.tool-content h3 { margin: 7px 0 7px; font: 600 22px/1.15 var(--font-display); }
.tool-content p { max-width: 670px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.tool-card > a { display: inline-flex; align-items: center; gap: 25px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.03); text-decoration: none; font-size: 11px; font-weight: 700; }
.home-footer { max-width: 1280px; }

/* Auth */
.auth-page { display: grid; place-items: center; padding: 30px 18px; }
.auth-shell { width: min(430px, 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 20px; color: var(--text); text-decoration: none; }
.auth-brand strong { font: 700 14px/1 var(--font-display); letter-spacing: .14em; }
.auth-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(22,22,25,.98), rgba(11,11,13,.96)); box-shadow: 0 35px 100px rgba(0,0,0,.38); }
.auth-card h1 { margin: 10px 0 7px; font: 600 34px/1.05 var(--font-display); letter-spacing: -.045em; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; }
.auth-form label span { color: var(--soft); font-size: 11px; font-weight: 600; }
.auth-form input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: rgba(255,255,255,.028); }
.auth-form input:focus { border-color: rgba(255,61,81,.75); box-shadow: 0 0 0 3px rgba(255,61,81,.1); }
.auth-form button { display: flex; align-items: center; justify-content: space-between; min-height: 50px; margin-top: 5px; padding: 0 17px; cursor: pointer; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; color: #fff; background: linear-gradient(115deg, #d7193b, var(--accent), var(--accent-2)); font-weight: 700; }
.auth-error { margin: -7px 0 18px; padding: 10px 12px; border: 1px solid rgba(255,61,81,.35); border-radius: 10px; color: #ffb1ba; background: rgba(255,61,81,.07); font-size: 11px; line-height: 1.45; }
.auth-switch { display: block; margin-top: 20px; color: var(--muted); text-align: center; }
.auth-switch a { color: #fff; font-weight: 700; }

[hidden] { display: none !important; }

@media (max-width: 1120px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-card { position: relative; top: 0; }
  .browser-frame { height: 720px; }
}

@media (max-width: 760px) {
  .topbar, .app-shell, .site-footer { width: min(100% - 26px, 680px); }
  .topbar { height: 72px; }
  .header-status span:last-child { display: none; }
  .header-status { padding: 9px; }
  .brand-logo-shell { width: 74px; height: 34px; padding: 2px 3px; border-radius: 8px; }
  .brand-copy { display: none; }
  .contact-copy small { display: none; }
  .app-shell { padding-top: 44px; }
  .intro-panel { grid-template-columns: 1fr; align-items: start; gap: 25px; }
  .intro-panel h1 { font-size: clamp(39px, 12vw, 62px); }
  .flow-steps { width: 100%; overflow-x: auto; }
  .flow-steps li { flex: 1; justify-content: center; }
  .builder-card, .preview-card { padding: 18px; border-radius: 18px; }
  .field-grid, .template-options { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { grid-template-columns: 1fr; }
  .button-primary { grid-row: 1; }
  .browser-frame { height: 600px; }
  .result-actions { grid-template-columns: 1fr; }
  .plan-status { padding: 6px 8px; }
  .plan-status small { display: none; }
  .home-shell { width: min(100% - 26px, 680px); }
  .home-hero { min-height: auto; padding: 55px 0 70px; }
  .home-hero > p { font-size: 14px; }
  .tools-heading { align-items: flex-start; flex-direction: column; }
  .tools-heading > p { text-align: left; }
  .tool-card { grid-template-columns: auto minmax(0,1fr); }
  .tool-card > a { grid-column: 1 / -1; justify-content: space-between; }
  .history-toggle span { display: none; }
  .history-toggle { width: 52px; padding: 0 6px; justify-content: center; }
}

@media (max-width: 460px) {
  .brand-copy small { display: none; }
  .header-status { display: none; }
  .contact-button { min-height: 43px; padding-right: 8px; }
  .contact-icon { width: 29px; height: 29px; }
  .contact-icon img { width: 16px; height: 16px; }
  .contact-button b { display: none; }
  .intro-panel p { font-size: 14px; }
  .flow-steps li { padding: 8px; font-size: 9px; }
  .preview-toolbar { align-items: flex-start; }
  .browser-frame { height: 570px; border-radius: 13px; }
  .browser-frame.is-mobile { width: 100%; }
  .browser-bar p { margin-right: 20px; }
  .site-footer { align-items: flex-start; gap: 12px; }
  .site-footer nav { align-items: flex-end; flex-direction: column; gap: 7px; }
  .plan-status { display: none; }
  .logout-button { padding: 0 9px; }
  .home-topbar { width: min(100% - 22px, 680px); }
  .home-nav { gap: 6px; }
  .home-user { display: none; }
  .nav-button { min-height: 37px; padding: 0 11px; }
  .home-hero-logo { width: 145px; }
  .home-hero h1 { font-size: clamp(39px, 12vw, 55px); }
  .home-cta { width: 100%; flex-direction: column; }
  .home-primary-cta, .home-secondary-cta { width: 100%; }
  .tool-card { padding: 18px; gap: 15px; }
  .tool-icon { width: 54px; height: 54px; border-radius: 14px; }
  .tool-content h3 { font-size: 18px; }
  .auth-card { padding: 24px 20px; }
}

/* =========================================================
   UI v3 — countdown masa aktif, lock overlay, animasi halus
   ========================================================= */

@keyframes s7-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes s7-blob-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,-22px) scale(1.08); } }
@keyframes s7-blob-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-24px,20px) scale(1.1); } }
@keyframes s7-pip { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(62,230,165,.5); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(62,230,165,0); } }
@keyframes s7-pip-red { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,61,81,.55); } 50% { opacity: .5; box-shadow: 0 0 0 5px rgba(255,61,81,0); } }
@keyframes s7-tick { from { transform: translateY(-42%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes s7-shine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes s7-lock-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Entrance halus untuk panel utama */
.intro-panel { animation: s7-fade-up .55s ease both; }
.builder-card { animation: s7-fade-up .6s .06s ease both; }
.preview-card { animation: s7-fade-up .6s .12s ease both; }
.tool-card, .auth-card { animation: s7-fade-up .55s ease both; }

/* Ambient blobs mengambang pelan */
.ambient-one { animation: s7-blob-a 17s ease-in-out infinite; }
.ambient-two { animation: s7-blob-b 20s ease-in-out infinite; }

/* Kilau tipis pada tombol utama */
.button-primary, .home-primary-cta, .auth-form button { position: relative; overflow: hidden; }
.button-primary::after, .home-primary-cta::after, .auth-form button::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-130%); pointer-events: none;
}
.button-primary:hover::after, .home-primary-cta:hover::after, .auth-form button:hover::after { animation: s7-shine .9s ease; }

/* ---- Countdown masa aktif ---- */
.plan-status { flex-direction: column; align-items: flex-end; gap: 5px; padding: 8px 12px; transition: border-color .25s, background .25s; }
.plan-status small { display: inline-flex; align-items: center; gap: 6px; }
.plan-pip { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: s7-pip 2.2s ease-in-out infinite; }

.countdown { display: inline-flex; align-items: flex-start; gap: 4px; }
.cd-seg { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 30px; padding: 5px 6px 4px; border-radius: 9px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }
.cd-seg b { position: relative; font: 700 15px/1 var(--font-display); letter-spacing: .02em; color: var(--text); font-variant-numeric: tabular-nums; animation: s7-tick .35s ease; }
.cd-seg i { font-style: normal; font-size: 7px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cd-sep { align-self: flex-start; margin-top: 6px; color: var(--muted); font: 700 13px/1 var(--font-display); }

/* ---- Kuota build per plan ---- */
.build-quota { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.quota-count { display: inline-flex; align-items: baseline; gap: 6px; }
.quota-count b { font: 700 20px/1 var(--font-display); letter-spacing: .01em; color: var(--text); font-variant-numeric: tabular-nums; animation: s7-tick .35s ease; }
.quota-count i { font-style: normal; font-size: 8px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.quota-mobile-label { display: none; }
.quota-track { width: 118px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.quota-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--success), #7bf0c2); transition: width .4s ease; }

.plan-status.is-urgent { border-color: rgba(255,61,81,.4); background: rgba(255,61,81,.06); }
.plan-status.is-urgent small { color: var(--accent); }
.plan-status.is-urgent .plan-pip { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: s7-pip-red 1s ease-in-out infinite; }
.plan-status.is-urgent .quota-count b { color: #ffd0d6; }
.plan-status.is-urgent .quota-track i { background: linear-gradient(90deg, var(--accent), #ff8a97); }
.plan-status[data-locked="true"] { border-color: rgba(255,61,81,.5); background: rgba(255,61,81,.08); }
.plan-expired-tag { color: #ffb1ba; font: 700 10px/1.2 var(--font-display); letter-spacing: .08em; }

/* ---- Overlay kunci dashboard ---- */
.lock-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(6,6,8,.78); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.lock-card { width: min(430px, 100%); padding: 34px 30px; text-align: center; border: 1px solid rgba(255,61,81,.28); border-radius: 24px; background: linear-gradient(160deg, rgba(26,20,22,.98), rgba(12,11,13,.98)); box-shadow: 0 40px 120px rgba(0,0,0,.6), inset 0 1px rgba(255,255,255,.04); animation: s7-lock-in .5s cubic-bezier(.2,.7,.3,1) both; }
.lock-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), #b80f30); box-shadow: 0 16px 38px rgba(255,61,81,.3), inset 0 1px rgba(255,255,255,.2); }
.lock-card .section-kicker { display: block; margin-bottom: 8px; }
.lock-card h2 { margin: 0 0 10px; font: 600 25px/1.15 var(--font-display); letter-spacing: -.03em; }
.lock-card p { margin: 0 auto 22px; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.lock-cta { display: inline-flex; align-items: center; gap: 9px; min-height: 50px; padding: 0 22px; border-radius: 13px; color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; border: 1px solid rgba(255,255,255,.15); background: linear-gradient(115deg, #d7193b, var(--accent), var(--accent-2)); box-shadow: 0 16px 34px rgba(255,61,81,.24); transition: transform .18s; }
.lock-cta:hover { transform: translateY(-2px); }
.lock-cta b { font-style: normal; }
.lock-logout { margin-top: 14px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 12px; font-weight: 700; transition: color .18s, border-color .18s; }
.lock-logout:hover { color: var(--text); border-color: var(--line-strong); }

/* Saat terkunci: redupkan & matikan interaksi workspace */
body.is-locked .workspace-grid, body.is-locked .intro-panel { filter: saturate(.55) blur(1px); opacity: .5; pointer-events: none; user-select: none; }

@media (max-width: 760px) {
  .plan-status { padding: 6px 9px; }
  .plan-status small { display: inline-flex; }
  .cd-seg { min-width: 26px; padding: 4px 5px; }
  .cd-seg b { font-size: 13px; }
  .quota-count b { font-size: 17px; }
}

@media (max-width: 460px) {
  .plan-status { display: flex; order: 5; width: 100%; align-items: center; }
  .plan-status small { display: none; }
  .cd-seg i { font-size: 6px; }
  .build-quota { flex-direction: row; align-items: center; gap: 10px; width: 100%; justify-content: space-between; }
  .quota-track { flex: 1; width: auto; max-width: 200px; }
  .lock-card { padding: 28px 20px; }
  .lock-card h2 { font-size: 21px; }
  body.builder-page .topbar, body.result-page .topbar { height: auto; min-height: 72px; padding: 9px 0; align-items: flex-start; }
  body.builder-page .header-actions, body.result-page .header-actions { max-width: calc(100% - 82px); flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  body.builder-page .header-actions .contact-button, body.result-page .header-actions .contact-button { display: none; }
  body.builder-page .plan-status, body.result-page .plan-status { order: 10; width: 100%; min-width: 150px; padding: 6px 9px; align-items: stretch; }
  body.builder-page .build-quota, body.result-page .build-quota { width: 100%; }
}

/* ---- Link kembali ke home di halaman auth ---- */
.auth-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; transition: color .18s; }
.auth-back:hover { color: var(--text); }
.auth-back span { font-size: 14px; line-height: 1; }

/* ---- Panel admin ---- */
.admin-whoami { color: var(--muted); font-size: 12px; }
.admin-whoami strong { color: var(--text); }
.admin-header-badge { display: inline-flex; align-items: center; min-height: 38px; padding: 0 13px; border: 1px solid rgba(255,61,81,.3); border-radius: 999px; color: #ffd7dc; background: rgba(255,61,81,.075); font: 700 9px/1 var(--font-display); letter-spacing: .12em; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-stat { flex: 1 1 120px; min-width: 118px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #151518; }
.admin-stat span { display: block; color: var(--muted); font: 700 8px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.admin-stat strong { display: block; margin: 8px 0 2px; font: 600 30px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.admin-stat small { color: var(--muted); font-size: 11px; }

.admin-flash { margin: 4px 0 -6px; padding: 12px 15px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.admin-flash.is-ok { color: #062; border: 1px solid rgba(62,230,165,.35); background: rgba(62,230,165,.08); color: var(--success); }
.admin-flash.is-error { color: #ffb1ba; border: 1px solid rgba(255,61,81,.4); background: rgba(255,61,81,.08); }

.admin-card { margin-top: 4px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 760px; }
.admin-table thead th { position: sticky; top: 0; padding: 11px 12px; text-align: left; color: var(--muted); font: 700 9px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; background: #131316; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; color: var(--text); }
.admin-table tbody tr:last-child td, .admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: rgba(255,255,255,.02); }
.admin-user-cell strong { display: block; font-size: 13px; }
.admin-user-cell small { display: block; color: var(--muted); font-size: 11px; }
.admin-user-cell .admin-user-id { color: #5f5f68; font-size: 10px; margin-top: 2px; }
.admin-remaining { font-weight: 700; font-variant-numeric: tabular-nums; }

.admin-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font: 700 9px/1.4 var(--font-display); letter-spacing: .06em; }
.admin-badge-user { color: var(--muted); border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }
.admin-badge-admin { color: #ffd9de; border: 1px solid rgba(255,61,81,.4); background: rgba(255,61,81,.1); }

.admin-edit-form { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.admin-edit-form select, .admin-edit-form input { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #121214; font-size: 12px; }
.admin-edit-form input[type="number"] { width: 74px; }
.admin-edit-form select:disabled { opacity: .5; cursor: not-allowed; }
.admin-save { height: 34px; padding: 0 13px; cursor: pointer; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(115deg, #d7193b, var(--accent), var(--accent-2)); transition: transform .15s; }
.admin-save:hover { transform: translateY(-1px); }
.admin-empty { text-align: center; color: var(--muted); padding: 22px; }

@media (max-width: 760px) {
  .admin-whoami { display: none; }
}

/* Header builder/result khusus mobile: menu kiri, logo tepat di tengah. */
@media (max-width: 600px) {
  body.builder-page .topbar,
  body.result-page .topbar {
    display: grid;
    grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
    grid-template-rows: 46px;
    align-items: center;
    width: min(100% - 24px, 680px);
    height: auto;
    min-height: 0;
    padding: 10px 0;
  }

  body.builder-page .brand-lockup,
  body.result-page .brand-lockup {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  body.builder-page .brand-logo-shell,
  body.result-page .brand-logo-shell {
    width: 88px;
    height: 40px;
    padding: 2px 4px;
  }

  body.builder-page .brand-copy,
  body.result-page .brand-copy {
    display: none;
  }

  body.builder-page .topbar-primary,
  body.result-page .topbar-primary {
    display: contents;
  }

  body.builder-page .header-actions,
  body.result-page .header-actions {
    display: contents;
  }

  body.builder-page .history-toggle,
  body.result-page .history-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: 50px;
    min-height: 44px;
    padding: 0 6px;
    justify-content: center;
  }

  body.builder-page .history-toggle span,
  body.result-page .history-toggle span {
    display: none;
  }

  body.builder-page .logout-form {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  body.result-page .header-actions > .button-secondary {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 44px;
    padding: 0 9px;
    font-size: 10px;
  }

  body.builder-page .header-status,
  body.result-page .header-status,
  body.builder-page .header-actions .contact-button,
  body.result-page .header-actions .contact-button {
    display: none;
  }

  body.builder-page .plan-status,
  body.result-page .plan-status {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    order: initial;
    width: auto;
    min-width: 0;
    max-width: 90px;
    padding: 6px 9px;
    align-items: center;
    border-radius: 999px;
  }

  body.builder-page .plan-status small,
  body.result-page .plan-status small {
    display: none;
  }

  body.builder-page .build-quota,
  body.result-page .build-quota {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    gap: 5px;
  }

  body.builder-page .quota-track,
  body.result-page .quota-track {
    display: none;
  }

  body.builder-page .quota-count,
  body.result-page .quota-count {
    gap: 4px;
    white-space: nowrap;
  }

  body.builder-page .quota-count b,
  body.result-page .quota-count b {
    font-size: 16px;
  }

  body.builder-page .quota-count i,
  body.result-page .quota-count i {
    font-size: 7px;
    letter-spacing: .06em;
  }

  body.builder-page .quota-desktop-label { display: none; }
  body.builder-page .quota-mobile-label { display: inline; }

  body.admin-page .topbar {
    display: grid;
    grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
    grid-template-rows: 46px;
    align-items: center;
    width: min(100% - 24px, 680px);
    height: auto;
    min-height: 0;
    padding: 10px 0;
  }

  body.admin-page .topbar-primary,
  body.admin-page .header-actions { display: contents; }
  body.admin-page .brand-lockup { grid-column: 2; grid-row: 1; justify-self: center; }
  body.admin-page .brand-logo-shell { width: 88px; height: 40px; padding: 2px 4px; }
  body.admin-page .brand-copy { display: none; }
  body.admin-page .history-toggle { grid-column: 1; grid-row: 1; justify-self: start; width: 50px; min-height: 44px; padding: 0 6px; justify-content: center; }
  body.admin-page .history-toggle span { display: none; }
  body.admin-page .admin-header-badge { grid-column: 3; grid-row: 1; justify-self: end; min-height: 34px; padding: 0 10px; font-size: 8px; }

  .result-delete-form { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
