:root {
  --bg-1: #fdf6ec;
  --bg-2: #fbe9d7;
  --bg-3: #f7dcc4;
  --fg: #4a3526;
  --accent: #d9774f;
  --accent-dark: #b85c39;
  --ok: #6fa987;
  --maybe: #e0b94e;
  --no: #c97a6d;
  --card-bg: #ffffff;
  --border: #ecd9c2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  color: var(--fg);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, Arial, sans-serif;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

header.app-header {
  text-align: center;
  margin-bottom: 28px;
}

header.app-header h1 {
  font-size: 1.6rem;
  margin: 0 0 6px;
  color: var(--accent-dark);
}

header.app-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(74, 53, 38, 0.08);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 16px 0 6px;
}

label:first-child {
  margin-top: 0;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fffdf9;
  color: var(--fg);
}

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

textarea {
  resize: vertical;
  min-height: 70px;
}

.hint {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-dark);
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.btn.secondary:hover {
  background: var(--bg-2);
}

.btn.block {
  width: 100%;
  text-align: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.candidate-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.candidate-row input {
  flex: 1;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--no);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.add-candidate-btn {
  background: none;
  border: 1px dashed var(--accent);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  margin-top: 4px;
}

.error-box {
  background: #fdeceb;
  border: 1px solid var(--no);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin: 12px 0;
}

.success-box {
  background: #eaf5ee;
  border: 1px solid var(--ok);
  color: #2d6a4a;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.9rem;
  margin: 12px 0;
}

.share-url-box {
  display: flex;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  align-items: center;
  margin-bottom: 10px;
}

.share-url-box input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 0.85rem;
  padding: 0;
}

.copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.matrix th,
table.matrix td {
  border: 1px solid var(--border);
  padding: 8px 6px;
  text-align: center;
}

table.matrix th {
  background: var(--bg-2);
  font-weight: 600;
  white-space: nowrap;
}

table.matrix td.name-cell {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.mark.ok {
  background: #eaf5ee;
  color: var(--ok);
}

.mark.maybe {
  background: #fbf3e0;
  color: var(--maybe);
}

.mark.no {
  background: #fdeceb;
  color: var(--no);
}

button.mark-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px;
}

.best-row {
  background: #fdf6e8 !important;
}

.best-badge {
  display: inline-block;
  background: var(--ok);
  color: #fff;
  font-size: 0.72rem;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 6px;
}

.confirmed-banner {
  background: var(--ok);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.footer-note {
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.6;
  margin-top: 24px;
}

a {
  color: var(--accent-dark);
}

.loading {
  text-align: center;
  padding: 40px 0;
  opacity: 0.6;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeUp 0.4s ease-out;
}
