/* Evaluasi Kelompok: all rules are scoped under .ek-app so the WordPress theme is left alone.
   Layout: two tabs; on wide containers the rubric (left) and the group radar (right) sit side by side. */
.ek-app {
  --ek-bg: #f6f7f9;
  --ek-surface: #ffffff;
  --ek-ink: #14171f;
  --ek-ink-2: #4a505e;
  --ek-ink-3: #6e7483;
  --ek-line: #dfe2e8;
  --ek-line-2: #eceef2;
  --ek-accent: #1f4fb8;
  --ek-accent-soft: #e8eefb;
  --ek-good: #1a7f37;
  --ek-bad: #c0362c;
  /* WordPress core's system font stack (same as wp-admin) */
  --ek-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  container-type: inline-size;
  font-family: var(--ek-font);
  font-size: 16px;
  color: var(--ek-ink);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
}
.ek-app *, .ek-app *::before, .ek-app *::after { box-sizing: border-box; }
/* Use the system stack everywhere inside the app, overriding theme fonts on headings, buttons, inputs and SVG text. */
.ek-app, .ek-app h2, .ek-app h3, .ek-app b, .ek-app button, .ek-app input, .ek-app legend, .ek-app small, .ek-app svg, .ek-app svg text,
.ek-admin .ek-admin-viz, .ek-admin .ek-admin-viz button, .ek-admin .ek-admin-viz svg text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; letter-spacing: normal; }
.ek-app [hidden] { display: none !important; }
.ek-app h2, .ek-app h3 { margin: 0; line-height: 1.25; }
.ek-app p { margin: 0; }
.ek-app button { font: inherit; }
.ek-app :focus-visible { outline: 2px solid var(--ek-accent); outline-offset: 2px; }

/* Tabs */
.ek-steps { display: flex; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--ek-line); }
.ek-step {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0;
  border: 1px solid var(--ek-line); border-radius: 10px; background: var(--ek-surface); color: var(--ek-ink);
  cursor: pointer; text-align: left; box-shadow: none; text-transform: none; letter-spacing: normal;
}
.ek-step:hover { border-color: var(--ek-ink-3); background: var(--ek-surface); color: var(--ek-ink); }
.ek-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--ek-line-2); color: var(--ek-ink-2); }
.ek-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ek-t b { font-size: 0.95rem; }
.ek-t small { font-size: 0.78rem; color: var(--ek-ink-3); font-variant-numeric: tabular-nums; }
.ek-step[aria-current="page"] { border-color: var(--ek-accent); box-shadow: inset 0 0 0 1px var(--ek-accent); }
.ek-step[aria-current="page"] .ek-n { background: var(--ek-accent); color: #fff; }
.ek-step.ek-locked .ek-n { background: transparent; color: var(--ek-ink-2); border: 1.5px dashed var(--ek-ink-3); }

/* Page 1 */
.ek-naskah { max-width: 72ch; display: flex; flex-direction: column; gap: 12px; font-size: 1.02rem; }
.ek-naskah a { overflow-wrap: anywhere; }

/* Cards */
.ek-lock { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; border: 1px dashed var(--ek-ink-3); border-radius: 12px; background: var(--ek-surface); }
.ek-eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ek-ink-3); font-weight: 600; }
.ek-clock { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ek-note { font-size: 0.86rem; color: var(--ek-ink-2); }
.ek-status { font-size: 0.9rem; color: var(--ek-ink-2); }
.ek-status.ek-err { color: var(--ek-bad); }
.ek-status.ek-ok { color: var(--ek-good); }

/* Form */
.ek-app .ek-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; width: 100%; max-width: 420px; }
.ek-app .ek-field input {
  font: inherit; font-weight: 400; color: var(--ek-ink); background: var(--ek-surface);
  border: 1px solid var(--ek-line); border-radius: 8px; padding: 10px 12px; width: 100%; margin: 0;
}
.ek-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ek-app .ek-btn {
  font-weight: 600; border-radius: 8px; padding: 10px 18px; cursor: pointer; margin: 0;
  border: 1px solid var(--ek-accent); background: var(--ek-accent); color: #fff; text-transform: none; letter-spacing: normal;
}
.ek-app .ek-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ek-app .ek-btn.ek-ghost { background: transparent; color: var(--ek-ink); border-color: var(--ek-line); }
.ek-app .ek-link { background: none; border: 0; padding: 0; color: var(--ek-accent); text-decoration: underline; cursor: pointer; font-size: inherit; }
.ek-form { display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--ek-line); border-radius: 12px; background: var(--ek-surface); padding: 16px; }
.ek-panel-head { display: flex; flex-direction: column; line-height: 1.35; padding-bottom: 12px; border-bottom: 1px solid var(--ek-line-2); }
.ek-panel-head b { font-size: 1.1rem; }
.ek-panel-head small { color: var(--ek-ink-3); font-size: 0.85rem; }
.ek-aspect { border: 1px solid var(--ek-line); border-radius: 12px; padding: 14px; margin: 0; min-width: 0; background: var(--ek-bg); display: flex; flex-direction: column; gap: 10px; }
.ek-aspect legend { font-weight: 700; padding: 0; float: left; width: 100%; }
.ek-aspect legend + * { clear: both; }
.ek-def { color: var(--ek-ink-2); font-size: 0.9rem; }
.ek-scale { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ek-opt { position: relative; display: block; margin: 0; }
.ek-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ek-opt span { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ek-line); background: var(--ek-surface); font-size: 0.86rem; line-height: 1.4; color: var(--ek-ink-2); cursor: pointer; }
.ek-opt b { font-size: 1.05rem; color: var(--ek-ink); font-variant-numeric: tabular-nums; }
.ek-opt input:hover + span { border-color: var(--ek-ink-3); }
.ek-opt input:focus-visible + span { outline: 2px solid var(--ek-accent); outline-offset: 2px; }
.ek-opt input:checked + span { border-color: var(--ek-accent); background: var(--ek-accent-soft); color: var(--ek-ink); box-shadow: inset 0 0 0 1px var(--ek-accent); }

/* Result */
.ek-result { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ek-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--ek-line); }
.ek-result-head h3 { font-size: 1.2rem; }
.ek-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ek-good); }
.ek-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ek-good); animation: ek-pulse 2s ease-in-out infinite; }
@keyframes ek-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .ek-live i { animation: none; } }

/* Radar (shared with wp-admin) */
.ek-viz { display: flex; flex-direction: column; gap: 12px; }
.ek-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ek-app .ek-chip, .ek-admin .ek-chip {
  font-size: 0.85rem; font-weight: 500; padding: 5px 12px; margin: 0; border-radius: 999px; border: 1px solid var(--ek-line, #dfe2e8);
  background: #fff; color: #14171f; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: normal; box-shadow: none;
}
.ek-chip[aria-pressed="true"] { border-color: #14171f; box-shadow: inset 0 0 0 1px #14171f; }
.ek-chip i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.ek-chips-label { font-size: 0.8rem; color: #6e7483; align-self: center; margin-right: 2px; }
.ek-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: #4a505e; }
.ek-key span { display: inline-flex; align-items: center; gap: 6px; }
.ek-key i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.ek-key i.ek-thin { height: 2px; background: #8a90a0; }
.ek-key i.ek-thick { height: 4px; background: #14171f; }
.ek-key i.ek-band { height: 10px; background: rgba(110,116,131,.22); border: 1px solid rgba(110,116,131,.45); }
.ek-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ek-insight { background: #fff; border: 1px solid #dfe2e8; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ek-insight small { font-size: 0.78rem; color: #6e7483; }
.ek-insight b { font-size: 0.98rem; }
.ek-insight span { font-size: 0.8rem; color: #4a505e; }
.ek-chart { position: relative; background: #fff; border: 1px solid #dfe2e8; border-radius: 12px; padding: 8px; }
.ek-chart svg { display: block; width: 100%; height: auto; max-height: 78vh; margin-inline: auto; }
.ek-tip { position: absolute; pointer-events: none; background: #14171f; color: #fff; font-size: 0.8rem; padding: 6px 9px; border-radius: 6px; transform: translate(-50%, calc(-100% - 10px)); max-width: 260px; z-index: 2; }
.ek-table-wrap { overflow-x: auto; }
.ek-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.ek-table th, .ek-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #eceef2; }
.ek-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6e7483; }
.ek-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.ek-sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* Side by side when the content area is wide enough */
.ek-grid { display: flex; flex-direction: column; gap: 24px; }
/* Narrow content area: the radar comes first, the rubric below it. */
.ek-grid > .ek-result { order: -1; }
@container (min-width: 820px) {
  .ek-grid > .ek-result { order: 0; }
  .ek-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
  .ek-form-col, .ek-result { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
  .ek-chart svg { max-height: calc(100vh - 230px); }
}
@media (max-width: 560px) {
  .ek-t small { display: none; }
  .ek-step { padding: 8px 10px; }
}

/* wp-admin */
.ek-admin .ek-admin-viz { max-width: 980px; display: flex; flex-direction: column; gap: 16px; }
.ek-admin .ek-codes { max-width: 560px; }
.ek-admin .ek-code { font-size: 1.05em; letter-spacing: 0.08em; }

/* Tab 3: post-collaboration questionnaire */
.ek-kform { max-width: 860px; }
.ek-kh { font-size: 1.05rem; margin-top: 8px; }
.ek-likert { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ek-likert .ek-opt span { flex-direction: column; align-items: flex-start; gap: 2px; height: 100%; }
.ek-ktext { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.ek-kq { font-weight: 700; }
.ek-app textarea { font: inherit; font-weight: 400; color: var(--ek-ink); background: var(--ek-surface); border: 1px solid var(--ek-line); border-radius: 8px; padding: 10px 12px; width: 100%; resize: vertical; }
@media (max-width: 640px) {
  .ek-likert { grid-template-columns: minmax(0, 1fr); }
  .ek-likert .ek-opt span { flex-direction: row; align-items: baseline; gap: 10px; }
  .ek-steps { flex-wrap: wrap; }
  .ek-step { flex-basis: calc(50% - 4px); }
}

.ek-lock .ek-clock { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.ek-kp { color: var(--ek-ink-2); font-size: 0.95rem; white-space: pre-line; }

/* Tab 1: informed consent */
[data-page="persetujuan"] { display: flex; flex-direction: column; gap: 24px; }
[data-page="persetujuan"][hidden] { display: none; }
.ek-consent-info { max-width: 860px; }
.ek-consent-info h3 { font-size: 1.3rem; margin: 0; }
.ek-consent-info h4 { font-size: 1.05rem; margin: 8px 0 0; }
.ek-consent-info ol, .ek-consent-info ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.ek-info { border-collapse: collapse; font-size: 0.95rem; }
.ek-info th { text-align: left; vertical-align: top; padding: 4px 16px 4px 0; color: var(--ek-ink-2); font-weight: 600; white-space: nowrap; }
.ek-info td { padding: 4px 0; }
.ek-proc td { vertical-align: top; }
.ek-proc ul { font-size: 0.9rem; }
.ek-cform { max-width: 860px; }
.ek-pernyataan { margin: 0; line-height: 1.6; }
.ek-scale2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ek-cdone { max-width: 860px; }
@media (max-width: 560px) { .ek-info th { white-space: normal; } }
.ek-jk { border: 0; padding: 0; margin: 0; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.ek-jk legend { font-weight: 600; padding: 0; margin-bottom: 6px; }

/* Recruitment form and name picker */
[data-page="rekrutmen"] { display: flex; flex-direction: column; gap: 24px; }
[data-page="rekrutmen"][hidden] { display: none; }
.ek-rform { max-width: 860px; }
.ek-rform .ek-field, .ek-pick .ek-field { max-width: 420px; }
.ek-rform .ek-field:has(.ek-rgrid) { max-width: none; }
.ek-rgrid { display: flex; flex-direction: column; gap: 10px; font-weight: 400; }
.ek-req { color: #c0362c; font-weight: 600; }
.ek-pick { max-width: 860px; }
.ek-who-am-i { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.ek-who-am-i dt { color: var(--ek-ink-2); font-weight: 600; }
.ek-who-am-i dd { margin: 0; }
.ek-jadwal { max-width: 560px; }
.ek-jadwal .ek-opt b { font-size: 0.95rem; }
.ek-jadwal-list { margin: 0; padding-left: 1.3em; }
.ek-persiapan { border-top: 1px solid var(--ek-line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; max-width: 70ch; }
.ek-persiapan p { margin: 0; }
.ek-persiapan ol { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
