:root {
  color-scheme: light;
  --ink: #262238;
  --muted: #615e74;
  --brand: #523d83;
  --brand-dark: #3d2b65;
  --brand-soft: #f0ebf9;
  --line: #e5e0ee;
  --surface: #fff;
  --focus: #7954bd;
  --shadow: 0 12px 32px rgba(48, 34, 82, 0.08);
}
body {
  color: var(--ink);
  background: #f6f4fa;
}
h1 {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}
h2 {
  color: var(--ink);
  font-size: 1.1rem;
}
a {
  color: var(--brand);
  text-decoration: none;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.app-wrap .container {
  padding: clamp(1rem, 3vw, 2rem);
}
.topbar {
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.topbar-title {
  color: var(--ink);
}
.topbar-date,
.muted {
  color: var(--muted);
}
.sidebar {
  box-shadow: none;
  border-right: 1px solid var(--line);
}
.sidebar-brand,
.navbar .brand {
  color: var(--brand-dark);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar-link {
  border-radius: 10px;
  min-height: 42px;
  color: var(--muted);
}
.sidebar-link:hover,
.sidebar-link.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.sidebar-link.active {
  font-weight: 700;
}
.sidebar-footer form button {
  width: 100%;
  text-align: left;
  margin: 0;
}
.card,
.modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.btn,
form button:not(.sidebar-link),
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  max-width: 100%;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover,
form button:not(.sidebar-link):hover,
.action-button:hover {
  color: #fff;
  background: var(--brand-dark);
}
.btn.btn-secondary,
form button.btn-secondary,
.action-button.secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: #ded4ee;
}
.btn.btn-secondary:hover,
form button.btn-secondary:hover,
.action-button.secondary:hover {
  background: #e5daf6;
  color: var(--brand-dark);
}
.btn.btn-danger {
  background: #f9e8ec;
  color: #8d2942;
  border-color: #f1cbd5;
}
.btn.btn-danger:hover {
  background: #f6d7df;
  color: #7f1f37;
}
.btn.btn-small {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-block: 0.65rem;
}
.card > .btn + .btn {
  margin-inline-start: 0.4rem;
}
.scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-block: 1rem 0.25rem;
}
.scroll table {
  min-width: 32rem;
  margin: 0;
}
.scroll th {
  background: #f5f1fa;
  color: #484059;
  font-weight: 700;
}
.scroll th,
.scroll td {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
}
.scroll tr:last-child td {
  border-bottom: 0;
}
.scroll td:last-child .btn {
  margin: 0.15rem;
}
.scroll td form {
  display: inline;
}
form label {
  color: var(--ink);
}
form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
form select,
form textarea {
  background: #fcfbfe;
  border: 1px solid #d8d2e4;
  border-radius: 10px;
  color: var(--ink);
  min-height: 42px;
}
form
  label
  > :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  margin-top: 0.3rem;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}
.login-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 18%, #ece3fa, #f8f6fb 65%);
}
.login-page .navbar {
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.login-page .container {
  max-width: 460px;
}
.login-form {
  max-width: 100%;
  padding: clamp(1.35rem, 5vw, 2rem);
}
.login-form h1 {
  font-size: 1.65rem;
}
.login-form form > button {
  width: 100%;
  margin-top: 1.05rem;
}
.login-footer {
  margin-bottom: 0;
}
.login-footer .action-button {
  width: 100%;
}
.prototype-notice {
  color: #5c466a;
  background: #f4eef8;
  border: 1px solid #e5d8ee;
}
.modal-overlay {
  padding: 1rem;
  backdrop-filter: blur(4px);
}
body.modal-active {
  overflow: hidden;
}
.modal {
  max-width: 560px;
}
.modal-header {
  border-bottom: 1px solid var(--line);
}
.modal-close {
  min-height: 36px;
  min-width: 36px;
}
.management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.85rem;
}
.management-grid .action-button {
  justify-content: space-between;
  min-height: 58px;
}
details {
  margin-block: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
summary {
  font-weight: 650;
  cursor: pointer;
}
.question-block {
  margin-block: 0.75rem;
  border: 1px solid var(--line);
  background: #fcfbfe;
  border-radius: 12px;
  padding: 0.8rem 1rem;
}
.question-block label {
  margin-top: 0;
}
.survey-progress {
  color: var(--muted);
  margin-block: 0.75rem;
}
.survey-progress progress {
  width: 100%;
  height: 0.6rem;
  accent-color: var(--brand);
}
.copy-group {
  display: flex;
  align-items: end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.copy-group label {
  flex: 1 1 15rem;
}
.copy-group input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  min-height: 42px;
}
.copy-group [role="status"]:empty {
  display: none;
}
@media (max-width: 680px) {
  .app-wrap .container {
    padding: 0.9rem;
  }
  .topbar {
    padding: 1rem;
  }
  .topbar-date {
    display: none;
  }
  .card {
    padding: 1rem;
  }
  .sidebar:not(.collapsed) {
    box-shadow: var(--shadow);
  }
  .sidebar:not(.collapsed) ~ .main-wrap {
    margin-left: 72px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
