:root {
  --bg: #eef2f5;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-muted: #6b7280;
  --accent: #3f7f8f;
  --accent-hover: #336874;
  --border: #dde3e8;
  --hint-bg: #fdf6e3;
  --hint-border: #e8c468;
  --example-bg: #eef7f0;
  --example-border: #7fb98f;
  --warning-bg: #fdece0;
  --warning-border: #e08a4f;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  height: fit-content;
}

.card-wide {
  max-width: 1080px;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 20px;
  color: var(--text);
}

.home-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
}

.home-wrapper .card {
  width: auto;
  max-width: 400px;
  padding: 24px;
}

.brand-title {
  text-align: center;
  margin: 0 0 30px;
  font-size: 2.0rem;
}

.brand-logo {
  display: block;
  width: 20%;
  height: auto;
  margin-bottom: 32px;
}

.home-icon-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: var(--accent);
  text-decoration: none;
}

.home-icon-btn:hover {
  background: #f2f8f9;
}

.admin-link-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 4.6rem;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.admin-link-btn:hover {
  background: #f2f8f9;
}

.home-icon-btn svg {
  width: 25px;
  height: 25px;
}

.ai-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ai-loading-overlay[hidden] {
  display: none;
}

.ai-loading-box {
  text-align: center;
}

.ai-loading-icon {
  width: 72px;
  height: auto;
  animation: ai-loading-bounce 1s infinite ease-in-out;
}

.ai-loading-box p {
  margin: 12px 0 0;
  font-weight: 600;
  color: var(--text);
}

@keyframes ai-loading-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

p {
  margin: 0 0 16px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.session-progress {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.progress {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.situation-box {
  background: #f4f6f8;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  font-size: 1.15rem;
}

textarea,
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 6px 0 16px;
  background: #fff;
  color: var(--text);
}

textarea:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.login-form h2 {
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.15rem;
}

.login-form label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.login-form input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.login-form button {
  display: block;
  width: 100%;
  background: #c1c2c7;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0 0;
}

.login-form button:hover {
  background: #5b5959;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  margin: 4px 8px 4px 0;
}

button:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

button.secondary:hover {
  background: #f2f8f9;
}

.hint-box {
  background: var(--hint-bg);
  border-left: 4px solid var(--hint-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.hint-box .label {
  font-weight: 600;
  color: #8a6d1f;
  display: block;
  margin-bottom: 4px;
}

.example-box {
  background: var(--example-bg);
  border-left: 4px solid var(--example-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.example-box .label {
  font-weight: 600;
  color: #3c6b48;
  display: block;
  margin-bottom: 4px;
}

.warning-box {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.error {
  color: #b3432b;
  background: #fdece7;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.countdown {
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  color: var(--accent);
  margin: 24px 0;
}

.first-response-label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.nav {
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  text-decoration: underline;
}

.nav .sep {
  color: var(--border);
  margin: 0 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #f4f6f8;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.wrap-cell {
  min-width: 160px;
  max-width: 320px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.table-scroll {
  overflow-x: auto;
}

.table-scroll table {
  width: max-content;
  min-width: 100%;
}

tr.flagged {
  background: var(--warning-bg);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #eef2f5;
  color: var(--text-muted);
  font-weight: 500;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 8px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.field-row input[type="number"] {
  width: 70px;
  margin: 0;
}

.field-row .field-label {
  min-width: 150px;
  font-weight: 500;
}

select {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 6px 0 16px;
  background: #fff;
  color: var(--text);
}
