* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.brand {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
  color: var(--green);
}

.create-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 18px 5vw;
}

.create-shell {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
}

.create-title {
  display: grid;
  gap: 4px;
}

.create-title span {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}

.create-title h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.create-title p {
  max-width: 640px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.mode-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.mode-card.selected {
  border-color: var(--green);
  background: var(--soft);
}

.mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.mode-card strong {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.is-hidden {
  display: none !important;
}

.condition-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--white);
}

.condition-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.condition-row:last-child {
  border-bottom: 0;
}

.condition-row h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 950;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.option-list.compact {
  max-width: none;
}

.option-list button {
  min-width: 86px;
  min-height: 42px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.option-list button:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.option-list button.selected {
  border-color: var(--green);
  background: var(--green);
  color: var(--lime);
}

.create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.create-actions div {
  display: flex;
  gap: 12px;
}

.create-actions .left-actions {
  display: flex;
  gap: 12px;
}

.saved-session-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 10, 0.68);
  backdrop-filter: blur(3px);
}

.saved-session-dialog {
  width: min(760px, 100%);
  max-height: min(760px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.saved-session-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.saved-session-dialog header span {
  color: var(--green);
  font-weight: 900;
}

.saved-session-dialog h2,
.saved-session-dialog h3 {
  margin: 0;
  font-weight: 950;
}

.saved-session-dialog header button {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.saved-session-groups {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  overflow: hidden;
}

.saved-session-groups section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 180px;
  max-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  overflow: hidden;
}

.saved-session-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.saved-session-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}

.saved-session-item:hover {
  border-color: var(--green);
}

.saved-session-empty {
  color: var(--muted);
  font-weight: 800;
}

.study-plan-modal {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 10, 0.68);
  backdrop-filter: blur(3px);
}

.study-plan-dialog {
  width: min(720px, 100%);
  max-height: min(720px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

@media (prefers-reduced-motion: no-preference) {
  .saved-session-modal:not(.is-hidden) .saved-session-dialog,
  .study-plan-modal:not(.is-hidden) .study-plan-dialog {
    animation: create-dialog-in 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }
}

@keyframes create-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.study-plan-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.study-plan-dialog header span {
  color: var(--green);
  font-weight: 900;
}

.study-plan-dialog h2 {
  margin: 0;
  font-weight: 950;
}

.study-plan-dialog header button {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.study-plan-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.study-plan-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.study-plan-item:hover {
  border-color: var(--green);
  background: var(--white);
}

.study-plan-item strong {
  min-width: 0;
  font-size: 20px;
  font-weight: 950;
}

.study-plan-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.study-plan-item em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--white);
  color: var(--green);
  font-style: normal;
  font-weight: 950;
}

.study-plan-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 860px) {.create-page {
    min-height: calc(100vh - 122px);
    align-items: start;
    padding: 24px;
  }

  .condition-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .mode-panel {
    grid-template-columns: 1fr;
  }

  .saved-session-groups {
    grid-template-columns: 1fr;
  }

  .study-plan-item {
    grid-template-columns: 1fr;
  }

  .study-plan-item em {
    grid-row: auto;
    grid-column: auto;
    justify-self: start;
  }

  .create-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .create-actions div {
    flex-direction: column;
  }

  .create-actions .left-actions {
    flex-direction: column;
  }
}
