/* static/style.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #f0f2f5;
  color: #222222;
  font-family: "Helvetica Neue", Helvetica, Arial, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: #2a6496;
  text-decoration: none;
}

a:hover {
  color: #1d4669;
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background-color: #2c3e50;
  border-bottom: 1px solid #1a252f;
  color: #ffffff;
  width: 100%;
  flex-shrink: 0;
}

.topbar-inner {
  width: 100%;
  margin: 0;
  padding: 0 20px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
}

.brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 10px 0;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.brand:hover {
  color: #e6ecf0;
  text-decoration: none;
}

.topbar-nav {
  display: flex;
  align-items: stretch;
  font-size: 13px;
}

.topbar-nav a {
  color: #d5dde5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  border: 0;
  text-decoration: none;
  font-weight: 600;
}

.topbar-nav a:hover,
.topbar-nav a:active {
  color: #ffffff;
  background-color: #21303f;
  text-decoration: none;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.topbar-sub {
  color: #9fb1c1;
  font-size: 13px;
}

main {
  width: 100%;
  max-width: 1080px;
  margin: 20px auto 40px auto;
  padding: 0 20px;
  flex: 1 0 auto;
}

main.home-layout {
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar logo"
    "sidebar actions";
  align-items: start;
}

h1, h2, h3 {
  margin: 0 0 12px 0;
  font-weight: 700;
  color: #1f2933;
  line-height: 1.3;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
  margin-top: 18px;
}

p {
  margin: 0 0 12px 0;
}

hr {
  border: 0;
  border-top: 1px solid #e2e5e9;
  margin: 16px 0;
}

.muted {
  color: #666666;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.panel {
  background-color: #ffffff;
  border: 0;
  border-radius: 3px;
  padding: 18px 20px;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  border-bottom: 1px solid #e6e9ed;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header h1 {
  margin-bottom: 2px;
}

.home-sidebar {
  grid-area: sidebar;
  background-color: #ffffff;
  padding: 24px 20px;
  align-self: stretch;
  min-width: 0;
}

.home-logo {
  grid-area: logo;
}

.home-actions {
  grid-area: actions;
  padding: 0 28px 28px 28px;
  min-width: 0;
}

.home-actions-inner {
  max-width: 720px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 3px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.home-action-col h2 {
  font-size: 15px;
  margin-bottom: 10px;
}

.home-logo-box {
  text-align: center;
  padding: 28px 24px 18px 24px;
  background: transparent;
  border: 0;
}

.home-logo-img {
  display: block;
  margin: 0 auto 14px auto;
  width: 300px;
  max-width: 100%;
  height: auto;
}

.home-logo-caption {
  font-size: 18px;
  font-weight: 700;
  color: #1f2933;
  margin: 0;
}

.grid-room {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.grid-room > * {
  min-width: 0;
  max-width: 100%;
}

button,
input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  border-radius: 3px;
}

input[type="text"] {
  padding: 7px 10px;
  border: 1px solid #cccccc;
  background-color: #ffffff;
  color: #222222;
  width: 100%;
}

input[type="text"]:focus {
  outline: none;
  border-color: #4a89dc;
}

button {
  padding: 7px 14px;
  border: 1px solid #cccccc;
  background-color: #f5f5f5;
  color: #333333;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.4;
}

button:hover:not(:disabled) {
  background-color: #e8e8e8;
  border-color: #b8b8b8;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button.primary {
  background-color: #337ab7;
  border-color: #2e6da4;
  color: #ffffff;
}

button.primary:hover:not(:disabled) {
  background-color: #286090;
  border-color: #204d74;
}

button.btn-topbar {
  background-color: #2c3e50;
  border-color: #2c3e50;
  color: #ffffff;
}

button.btn-topbar:hover:not(:disabled) {
  background-color: #1f2d3b;
  border-color: #1f2d3b;
}

button.danger {
  background-color: #e53935;
  border-color: #d32f2f;
  color: #ffffff;
}

button.danger:hover:not(:disabled) {
  background-color: #c62828;
  border-color: #b71c1c;
  color: #ffffff;
}

button.btn-salad {
  background-color: #8bc34a;
  border-color: #7cb342;
  color: #1b2e07;
}

button.btn-salad:hover:not(:disabled) {
  background-color: #7cb342;
  border-color: #689f38;
  color: #111d04;
}

button.small {
  padding: 4px 9px;
  font-size: 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
  background-color: #e9ecef;
  color: #495057;
  border: 1px solid #d5d9df;
}

.owner-text {
  color: #2a6496;
  font-size: 13px;
  font-weight: 600;
}

.owner-label-salad {
  color: #55a630;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.member-label-blue {
  color: #2a6496;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.room-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.room-header-bar h1 {
  margin-bottom: 2px;
}

.room-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.room-item {
  padding: 12px 0;
  border-bottom: 1px solid #eceff2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.room-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.room-item:first-child {
  padding-top: 0;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qr-wrap {
  margin: 12px 0 14px 0;
  text-align: center;
  background-color: #fafafa;
  border: 0;
  padding: 14px;
  border-radius: 3px;
}

.qr-img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 240px;
  height: auto;
  background: #ffffff;
  cursor: pointer;
}

.room-code-big {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #1f2933;
  cursor: pointer;
  user-select: all;
}

.room-code-big:hover {
  color: #2a6496;
}

.pie-wrap {
  margin: 14px 0 18px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.pie-svg {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.pie-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.pie-legend li {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.protest-scale-box {
  margin: 10px 0 18px 0;
}

.protest-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #555555;
  margin-bottom: 4px;
}

.protest-scale-track {
  position: relative;
  height: 14px;
  background-color: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.protest-scale-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #666666;
  transform: translateX(-50%);
  z-index: 2;
}

.protest-scale-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
}

.protest-scale-fill.pos {
  left: 50%;
  background-color: #e53935;
}

.protest-scale-fill.neg {
  right: 50%;
  background-color: #2a6496;
}

.protest-scale-value {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
}

.tech-info {
  margin-top: 4px;
  font-size: 12px;
  color: #666666;
}

.compass-wrap {
  margin: 12px 0 18px 0;
  display: flex;
  justify-content: center;
}

.compass-svg {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  background: #ffffff;
}

.quiz-panel {
  max-width: 720px;
  margin: 0 auto 18px auto;
}

.quiz-progress {
  font-size: 13px;
  font-weight: 700;
  color: #337ab7;
  margin-bottom: 4px;
}

.quiz-question-box {
  min-height: 115px;
}

.quiz-question {
  font-size: 18px;
  font-weight: 700;
  color: #1f2933;
  line-height: 1.35;
  margin-bottom: 6px;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0 14px 0;
}

.quiz-answer-btn {
  text-align: left;
  padding: 11px 14px;
  background-color: #f8f9fa;
  border: 1px solid #d5d9df;
  color: #222222;
  width: 100%;
  font-weight: 600;
  transition: transform 0.06s ease, filter 0.06s ease;
}

.quiz-answer-btn:active,
.quiz-answer-btn.pressed {
  transform: scale(0.985);
  filter: brightness(0.9);
}

.quiz-answer-btn.ans-skip {
  background-color: #e0e3e7;
  border-color: #c8cdd3;
  color: #222222;
  text-align: left;
}

.quiz-answer-btn.ans-skip:hover {
  background-color: #d0d4d9;
}

.quiz-answer-btn.ans-0 {
  background-color: #9ccc65;
  border-color: #8bc34a;
  color: #1b2e07;
}

.quiz-answer-btn.ans-0:hover {
  background-color: #8bc34a;
}

.quiz-answer-btn.ans-1 {
  background-color: #d8b24c;
  border-color: #c6a03b;
  color: #2b2104;
}

.quiz-answer-btn.ans-1:hover {
  background-color: #cca43c;
}

.quiz-answer-btn.ans-2 {
  background-color: #ef9a9a;
  border-color: #e57373;
  color: #4a1010;
}

.quiz-answer-btn.ans-2:hover {
  background-color: #e58787;
}

.quiz-answer-btn.ans-3 {
  background-color: #e53935;
  border-color: #d32f2f;
  color: #ffffff;
}

.quiz-answer-btn.ans-3:hover {
  background-color: #c62828;
}

.quiz-answer-btn.selected {
  outline: 2px solid #000000;
  outline-offset: 1px;
}

.quiz-nav-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.quiz-nav-left {
  justify-self: start;
}

.quiz-nav-center {
  justify-self: center;
}

button.btn-skip {
  background-color: #e0e3e7;
  border-color: #c8cdd3;
  color: #333333;
}

button.btn-skip:hover:not(:disabled) {
  background-color: #d0d4d9;
  border-color: #b8bec6;
}

.result-quadrant {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.axis-row {
  margin-bottom: 10px;
}

.axis-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 3px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  border: 0;
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #dddddd;
  vertical-align: middle;
}

th {
  background-color: #f5f6f8;
  font-weight: 700;
  color: #333333;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}

tbody tr.is-me-row {
  background-color: #eef5fc;
  font-weight: 600;
}

.dot-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.site-footer {
  width: 100%;
  background-color: #2b2f33;
  color: #cfd4da;
  font-size: 12px;
  flex-shrink: 0;
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.wtp-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.wtp-modal-box {
  background-color: #ffffff;
  border-radius: 3px;
  padding: 18px 20px;
  width: 100%;
  max-width: 380px;
}

.wtp-modal-text {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #222222;
}

.wtp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 900px) {
  main.home-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "logo"
      "actions"
      "sidebar";
  }

  .home-logo-box {
    padding: 20px 12px 14px 12px;
  }

  .home-logo-img {
    width: 240px;
  }

  .home-actions {
    padding: 0;
    margin-bottom: 14px;
  }

  .home-actions-inner {
    max-width: none;
    border-radius: 0;
    padding: 16px 14px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-sidebar {
    padding: 16px 14px;
    margin-bottom: 14px;
  }

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

@media (max-width: 600px) {
  main {
    padding: 0 12px;
    margin-top: 14px;
  }

  .topbar-inner {
    padding: 0 12px;
  }

  .topbar-nav a {
    padding: 0 12px;
  }

  .site-footer-inner {
    padding: 12px;
  }

  .panel {
    padding: 14px;
  }

  button,
  input[type="text"] {
    min-height: 38px;
  }

  .row.stack-mobile > * {
    width: 100%;
  }

  .qr-img {
    max-width: 200px;
  }

  .quiz-question-box {
    min-height: 155px;
  }

  .quiz-question {
    font-size: 16px;
  }

  .quiz-answers {
    gap: 6px;
  }

  .quiz-answer-btn {
    padding: 9px 12px;
    min-height: 36px;
  }

  .pie-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .room-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #room-top-actions {
    width: 100%;
  }

  #room-top-actions button {
    flex: 1 1 auto;
  }
}
