
body {
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background-color: #f1f1f1;
  color: #333333;
  margin: 0;
  padding: 10px;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background-color: #ffffff;
  border: 1px solid #c0c0c0;
  padding: 20px;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 1.4em;
  color: #004488;
  border-bottom: 2px solid #004488;
  padding-bottom: 5px;
  margin-top: 0;
}

p.description {
  font-size: 0.9em;
  color: #555555;
  line-height: 1.45;
  margin-bottom: 14px;
}

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

.question-item {
  border: 1px solid #dddddd;
  background-color: #fafafa;
  padding: 15px;
  margin-bottom: 20px;
}

.question-title {
  font-weight: bold;
  font-size: 1.1em;
  margin-top: 0;
  margin-bottom: 5px;
  color: #111111;
}

.question-text {
  margin-bottom: 10px;
  font-size: 1em;
}

.input-group {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 8px;
}


input[type="text"] {
  flex-grow: 1;
  padding: 8px 10px;
  font-size: 16px; 
  border: 1px solid #aaaaaa;
  background-color: #ffffff;
  box-sizing: border-box;
}

input[type="text"]:focus {
  outline: 2px solid #0066cc;
  border-color: #0066cc;
  background-color: #f0f8ff;
}

button {
  padding: 8px 15px;
  font-size: 16px;
  background-color: #e0e0e0;
  color: #000000;
  border: 1px solid #777777;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

button:hover {
  background-color: #d0d0d0;
}

button:active {
  background-color: #bbbbbb;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

button:disabled {
  background-color: #f0f0f0;
  color: #aaaaaa;
  border: 1px solid #cccccc;
  box-shadow: none;
  cursor: not-allowed;
}

.result {
  font-weight: bold;
  font-size: 0.95em;
  min-height: 1.5em; 
}

.correct {
  color: #006600;
}

.incorrect {
  color: #cc0000;
}

.completed-message {
  display: none;
  background-color: #e6fced;
  border: 1px solid #4caf50;
  color: #006600;
  padding: 15px;
  text-align: center;
  font-weight: bold;
  margin-top: 20px;
}

.progress {
  font-size: 0.9em;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: right;
}

.notice {
  display: none;
  margin: 10px 0 15px;
  padding: 10px 12px;
  border: 1px solid #cc0000;
  background-color: #fff2f2;
  color: #990000;
  font-size: 0.9em;
  white-space: pre-wrap;
}

.notice.show {
  display: block;
}

.reset-container {
  margin-top: 40px;
  text-align: center;
  border-top: 1px dashed #cccccc;
  padding-top: 20px;
}

.reset-hint {
  font-size: 0.8em;
  color: #777;
}

.btn-reset {
  background-color: #ffffff;
  color: #cc0000;
  border: 1px solid #cc0000;
  font-size: 0.85em;
  padding: 5px 10px;
}

.btn-reset:hover {
  background-color: #ffeeee;
}

.group-panel {
  border: 1px solid #c7d7e6;
  background-color: #f9fcff;
  padding: 12px;
}

.group-title {
  font-weight: bold;
  margin: 0 0 8px;
  color: #222;
}

.group-status {
  font-size: 0.9em;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.group-small {
  font-size: 0.8em;
  color: #666;
  margin-top: 4px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.sync-meta {
  font-size: 0.8em;
  color: #555555;
  white-space: nowrap;
}

.answered-input {
  color: #2f5f2f;
  background-color: #f3faf3;
}

.answered-input:disabled {
  color: #4d6b4d;
  -webkit-text-fill-color: #4d6b4d;
  opacity: 0.8;
}

.group-panel hr {
  border: none;
  border-top: 1px dashed #cccccc;
  margin: 10px 0;
}

.group-members-section {
  margin-bottom: 12px;
}

.group-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.group-members-title {
  margin-bottom: 0;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c9d9e6;
  background-color: #ffffff;
  transform-origin: left center;
}

.member-row.entering {
  animation: member-insert 0.22s ease;
}

.member-row.removing {
  animation: member-remove 0.18s ease forwards;
}

.member-index {
  min-width: 40px;
  font-size: 0.85em;
  color: #34556a;
}

.member-row input[type="text"] {
  min-width: 0;
}

.member-remove {
  min-width: 44px;
  padding-left: 10px;
  padding-right: 10px;
}

.drawer-handle {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border-radius: 8px 8px 0 0;
  padding: 12px 8px;
  min-height: 132px;
  background-color: #0c5a8a;
  color: #ffffff;
  border: 1px solid #083f60;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.18);
}

.drawer-handle:hover {
  background-color: #0a4d75;
}

.drawer-handle-left {
  left: 0;
}

.drawer-handle-right {
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 33, 49, 0.32);
  z-index: 19;
}

.group-drawer {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 16px);
  z-index: 20;
  transition: transform 0.25s ease;
  pointer-events: none;
}

.group-drawer.open {
  transform: translateX(-50%) translateY(8px);
  pointer-events: auto;
}

.group-drawer-inner {
  background: linear-gradient(180deg, #ffffff 0%, #eef6fb 100%);
  border: 1px solid #8fb0c7;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.group-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.group-caution {
  margin-top: 4px;
  padding: 6px 8px;
  background-color: #fff8df;
  border: 1px solid #e1c56d;
  color: #6d5200;
  line-height: 1.35;
}

.drawer-close {
  min-width: 42px;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
}

.group-actions {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 16px;
  }

  .group-drawer {
    width: calc(100vw - 12px);
  }

  .drawer-handle {
    min-height: 116px;
    padding: 10px 6px;
    font-size: 14px;
  }

  .group-drawer-inner {
    padding: 12px;
  }

  .group-drawer-header {
    gap: 8px;
  }

  .member-row {
    padding: 8px;
  }

  .member-index {
    min-width: 32px;
  }
}

@keyframes member-insert {
  0% {
    opacity: 0;
    transform: translateX(28px) scaleX(0.92);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
  }
}

@keyframes member-remove {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 64px;
    margin-bottom: 0;
  }

  100% {
    opacity: 0;
    transform: scale(0.78);
    max-height: 0;
    margin-bottom: -8px;
    padding-top: 0;
    padding-bottom: 0;
  }
}
