:root {
  --bg: #f7f2f5;
  --surface: #ffffff;
  --surface-soft: #fbf7fb;
  --text: #241f27;
  --muted: #716b78;
  --line: #ece4ed;
  --red: #d7193f;
  --orange: #ce7708;
  --blue: #2148dc;
  --green: #26aa72;
  --gold: #b58b1c;
  --shadow: 0 18px 42px rgba(59, 43, 62, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #fff7fb 0%, var(--bg) 46%, #eee9f2 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.survey-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px 24px;
}

.dashboard-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px 36px;
}

.app-header,
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.app-header {
  text-align: center;
}

.title-block h1,
.dashboard-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
}

.title-block p,
.dashboard-header span,
.eyebrow {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.brand-mark {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(36, 31, 39, 0.08);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 10px 25px rgba(53, 45, 59, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
}

.brand-mark-gold {
  color: #74550a;
  background: radial-gradient(circle at 50% 38%, #fff8cf 0 26%, #e2bc46 27% 55%, #fff 56% 100%);
}

.brand-mark-blue {
  color: #173d8c;
  background: radial-gradient(circle at 50% 38%, #eef5ff 0 28%, #9db6ef 29% 58%, #fff 59% 100%);
}

.panel,
.metric-card,
.filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.survey-panel {
  padding: 18px;
}

.question-row,
.stats-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.question-row p,
.stats-head h2,
.section-title h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.soft-link,
.realtime-badge,
.section-title span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #f1dcc8;
  border-radius: 8px;
  color: #9a5b00;
  background: #fff6eb;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.rating-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.rating-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  min-height: 64px;
  padding: 10px 18px;
  border-radius: 8px;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16), 0 10px 22px rgba(47, 37, 51, 0.13);
  font-weight: 800;
  text-align: center;
  transition: transform 160ms ease, filter 160ms ease;
}

.rating-button:hover,
.rating-button:focus-visible {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.rating-button.is-busy {
  pointer-events: none;
  filter: grayscale(0.2) opacity(0.75);
}

.rating-bad {
  background: linear-gradient(90deg, #d7193f, #c81435);
}

.rating-ok {
  background: linear-gradient(90deg, #db8615, #c56f05);
}

.rating-great {
  background: linear-gradient(90deg, #2455ee, #1837c9);
}

.face-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.86rem;
  font-weight: 900;
}

.feedback {
  min-height: 34px;
  margin-top: 12px;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

.feedback.is-error {
  color: var(--red);
}

.stats-head {
  margin: 34px 0 14px;
}

.summary-grid,
.dashboard-grid,
.metric-grid {
  display: grid;
  gap: 18px;
}

.summary-grid {
  grid-template-columns: 1fr 1fr;
}

.summary-card {
  min-width: 0;
}

.donut {
  display: grid;
  width: min(100%, 176px);
  aspect-ratio: 1;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 0deg, #e8e1ea 0deg 360deg);
}

.donut-total {
  background: conic-gradient(var(--blue) 0deg, var(--blue) 0deg, #e8e1ea 0deg 360deg);
}

.donut > div {
  display: grid;
  width: 66%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  text-align: center;
}

.donut strong {
  font-size: clamp(1.35rem, 4vw, 2.05rem);
  line-height: 1;
}

.donut span,
.donut small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.count-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.count-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  border-bottom: 1px solid #f0e8f0;
}

.count-list dt,
.count-list dd {
  margin: 0;
  font-size: 0.87rem;
}

.count-list dt {
  color: var(--muted);
}

.count-list dd {
  font-weight: 900;
}

.count-list div:first-child dd {
  color: var(--red);
}

.count-list div:nth-child(2) dd {
  color: var(--orange);
}

.count-list div:nth-child(3) dd {
  color: var(--blue);
}

.count-list div:last-child dd {
  color: var(--text);
}

.app-footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-header {
  align-items: flex-end;
}

.eyebrow {
  margin-top: 0;
  color: #9a5b00;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(59, 43, 62, 0.08);
  font-weight: 850;
  white-space: nowrap;
}

.icon-button span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.82rem;
  line-height: 1;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  box-shadow: none;
}

.filter-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.filter-panel input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 750;
}

.metric-card strong {
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 1;
}

.metric-red strong {
  color: var(--red);
}

.metric-blue strong {
  color: var(--blue);
}

.dashboard-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.chart-panel,
.table-panel {
  padding: 18px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.count-list-wide {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.rating-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 850;
}

.rating-label.tidak_puas {
  background: var(--red);
}

.rating-label.puas {
  background: var(--orange);
}

.rating-label.sangat_puas {
  background: var(--blue);
}

.brand-logo,
.official-logo {
  display: block;
  object-fit: contain;
}

.brand-logo {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
}

.brand-logo-korlantas {
  padding: 2px;
}

.dashboard-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 10%, rgba(38, 170, 114, 0.12), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(33, 72, 220, 0.13), transparent 28%),
    linear-gradient(180deg, #fffafd 0%, #f4eef5 54%, #ebe7ef 100%);
}

.fullscreen-dashboard {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  max-width: none;
  height: 100vh;
  padding: clamp(18px, 3vw, 36px);
}

.display-header,
.device-header,
.export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 3vw, 34px);
  text-align: center;
}

.official-logo {
  width: clamp(76px, 10vw, 126px);
  height: clamp(76px, 10vw, 126px);
}

.official-logo-korlantas {
  padding: 3px;
}

.display-title p,
.device-header p,
.export-header p {
  margin: 0 0 7px;
  color: #9a5b00;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  font-weight: 900;
  text-transform: uppercase;
}

.display-title h1,
.device-header h1,
.export-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 4rem);
  line-height: 1.05;
}

.display-title span {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 750;
}

.display-scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
  align-items: stretch;
  min-height: 0;
  margin-top: clamp(18px, 3vw, 34px);
}

.display-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.display-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.display-card-head span {
  color: var(--muted);
  font-size: clamp(0.9rem, 1.3vw, 1.15rem);
  font-weight: 850;
}

.display-card-head strong {
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.7rem);
}

.display-donut {
  width: min(48vh, 34vw, 420px);
  align-self: center;
  margin: clamp(14px, 2vw, 24px) auto;
}

.display-donut strong {
  font-size: clamp(2.1rem, 5vw, 5.5rem);
}

.display-donut span {
  font-size: clamp(0.9rem, 1.4vw, 1.2rem);
  font-weight: 800;
}

.display-donut small {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.display-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.display-counts div {
  display: grid;
  gap: 6px;
  min-height: 76px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.display-counts dt,
.display-counts dd {
  margin: 0;
}

.display-counts dt {
  color: var(--muted);
  font-size: clamp(0.72rem, 1.1vw, 0.96rem);
  font-weight: 800;
}

.display-counts dd {
  font-size: clamp(1.2rem, 2.6vw, 2.4rem);
  font-weight: 950;
}

.display-counts div:first-child dd {
  color: var(--red);
}

.display-counts div:nth-child(2) dd {
  color: var(--orange);
}

.display-counts div:nth-child(3) dd {
  color: var(--blue);
}

.display-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.1vw, 1rem);
  font-weight: 800;
}

.device-page,
.export-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #fff9fc 0%, #f2edf5 100%);
}

.device-shell,
.export-shell {
  display: grid;
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 36px);
}

.device-shell {
  grid-template-rows: auto 1fr auto;
}

.device-rating-button {
  display: grid;
  gap: clamp(14px, 3vw, 28px);
  place-self: stretch;
  place-items: center;
  margin: clamp(22px, 5vw, 48px) 0;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18), 0 24px 46px rgba(47, 37, 51, 0.18);
  cursor: pointer;
  font: inherit;
  font-size: clamp(2.4rem, 10vw, 6.5rem);
  font-weight: 950;
}

.device-rating-button:disabled {
  cursor: wait;
  filter: grayscale(0.2) opacity(0.78);
}

.device-face {
  display: grid;
  width: clamp(86px, 20vw, 160px);
  aspect-ratio: 1;
  place-items: center;
  border: clamp(4px, 0.8vw, 8px) solid currentColor;
  border-radius: 50%;
  font-size: clamp(1.5rem, 6vw, 3.4rem);
}

.device-bad {
  background: linear-gradient(135deg, #d7193f, #ab0e2c);
}

.device-ok {
  background: linear-gradient(135deg, #db8615, #ad5c00);
}

.device-great {
  background: linear-gradient(135deg, #2455ee, #1732b6);
}

.device-feedback {
  min-height: 42px;
  margin: 0;
  color: var(--green);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 900;
  text-align: center;
}

.device-feedback.is-error {
  color: var(--red);
}

.export-shell {
  align-content: center;
  gap: 22px;
}

.export-panel {
  padding: clamp(18px, 4vw, 32px);
}

.export-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.export-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 850;
}

.export-form input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #1f8a57, #1767b1);
  box-shadow: 0 12px 26px rgba(23, 103, 177, 0.2);
  cursor: pointer;
  font: inherit;
}

.export-button span {
  font-size: 0.78rem;
  font-weight: 950;
}

.export-button strong {
  font-size: 0.98rem;
}

.buttons-only-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(181, 139, 28, 0.12), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(33, 72, 220, 0.12), transparent 30%),
    linear-gradient(180deg, #fff8fb 0%, #f4eef5 58%, #ebe7ee 100%);
}

.buttons-only-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(16px, 3vh, 28px);
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
}

.buttons-only-header {
  display: grid;
  grid-template-columns: clamp(54px, 12vw, 92px) 1fr clamp(54px, 12vw, 92px);
  gap: clamp(10px, 3vw, 24px);
  align-items: center;
  text-align: center;
}

.buttons-only-header p,
.buttons-only-header h1 {
  margin: 0;
}

.buttons-only-header p {
  color: #9a5b00;
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 900;
  text-transform: uppercase;
}

.buttons-only-header h1 {
  margin-top: 6px;
  font-size: clamp(1.15rem, 4vw, 2.2rem);
  line-height: 1.08;
}

.buttons-logo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.buttons-logo-korlantas {
  padding: 2px;
}

.buttons-only-stage {
  display: grid;
  gap: clamp(14px, 3vh, 24px);
  align-content: center;
}

.solo-rating {
  display: grid;
  grid-template-columns: clamp(58px, 13vw, 104px) 1fr;
  gap: clamp(12px, 3vw, 24px);
  align-items: center;
  min-height: clamp(110px, 23vh, 190px);
  padding: clamp(16px, 3vw, 28px);
  border-radius: 8px;
  color: #ffffff;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18), 0 20px 42px rgba(47, 37, 51, 0.16);
  transition: transform 150ms ease, filter 150ms ease;
}

.solo-rating:hover,
.solo-rating:focus-visible {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.solo-rating.is-busy {
  pointer-events: none;
  filter: grayscale(0.15) opacity(0.76);
}

.solo-rating strong {
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 1;
  text-align: center;
}

.solo-face {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border: clamp(3px, 0.7vw, 7px) solid currentColor;
  border-radius: 50%;
  font-size: clamp(1.25rem, 4vw, 3rem);
  font-weight: 950;
}

.solo-rating-bad {
  background: linear-gradient(135deg, #dc1b42, #ab0e2c);
}

.solo-rating-ok {
  background: linear-gradient(135deg, #de8614, #ac5d00);
}

.solo-rating-great {
  background: linear-gradient(135deg, #2455ee, #1732b6);
}

.buttons-only-feedback {
  min-height: 34px;
  margin: 0;
  color: var(--green);
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 900;
  text-align: center;
}

.buttons-only-feedback.is-error {
  color: var(--red);
}

@media (max-width: 820px) {
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .dashboard-page {
    overflow: auto;
  }

  .fullscreen-dashboard {
    height: auto;
    min-height: 100vh;
  }

  .display-scoreboard,
  .export-form {
    grid-template-columns: 1fr;
  }

  .display-donut {
    width: min(70vw, 320px);
  }

  .display-counts {
    grid-template-columns: 1fr 1fr;
  }

  .buttons-only-page {
    overflow: auto;
  }
}

@media (max-width: 560px) {
  .survey-shell {
    padding: 22px 12px 18px;
  }

  .app-header {
    gap: 8px;
  }

  .brand-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 0.7rem;
  }

  .brand-logo {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .title-block h1 {
    font-size: 1.12rem;
  }

  .title-block p {
    font-size: 0.86rem;
  }

  .summary-grid,
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .question-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .rating-button {
    min-height: 58px;
  }

  .display-header,
  .device-header,
  .export-header {
    gap: 8px;
  }

  .official-logo {
    width: 54px;
    height: 54px;
  }

  .display-title h1,
  .device-header h1,
  .export-header h1 {
    font-size: 1.15rem;
  }

  .display-counts {
    grid-template-columns: 1fr;
  }

  .buttons-only-shell {
    padding: 16px 12px 18px;
  }

  .solo-rating {
    grid-template-columns: 54px 1fr;
    min-height: 96px;
  }

  .solo-rating strong {
    font-size: clamp(1.7rem, 10vw, 2.8rem);
  }
}
