:root {
  --shell-bg: radial-gradient(circle at top left, #edf7f1 0%, #f6f3eb 42%, #eef3f9 100%);
  --shell-card-bg: rgba(255, 255, 255, 0.94);
  --shell-border: rgba(17, 36, 58, 0.08);
  --shell-shadow: 0 20px 50px rgba(17, 36, 58, 0.08);
  --shell-ink: #11243a;
  --shell-muted: #5f6f82;
  --shell-accent: #14532d;
  --shell-accent-soft: #e8f4eb;
  --shell-warm: #fff3df;
}

html,
body {
  min-height: 100%;
  background: var(--shell-bg);
}

body {
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--shell-ink);
}

.shell-nav {
  background: linear-gradient(90deg, #11243a 0%, #24506d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-main {
  padding-top: 2rem;
}

.shell-card {
  border: 1px solid var(--shell-border);
  box-shadow: var(--shell-shadow);
  background: var(--shell-card-bg);
  backdrop-filter: blur(12px);
  border-radius: 24px;
}

.login-body {
  background: #f5f7fb;
}

.login-main {
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
}

.login-container {
  width: 100%;
}

.login-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.login-card {
  width: min(100%, 420px);
  padding: 2rem;
  border: 1px solid rgba(17, 36, 58, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(17, 36, 58, 0.12);
}

.login-card__header {
  margin-bottom: 1.5rem;
}

.login-card__eyebrow {
  margin-bottom: 0.55rem;
  color: #27677c;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card__title {
  margin: 0;
  color: #11243a;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
}

.login-card__description {
  margin-top: 0.55rem;
  color: var(--shell-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form__field {
  margin-bottom: 0;
}

.login-form__label {
  margin-bottom: 0.42rem;
  color: #263b52;
  font-size: 0.9rem;
  font-weight: 700;
}

.login-form__control input {
  width: 100%;
  height: 2.9rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(17, 36, 58, 0.16);
  border-radius: 10px;
  background: #fbfcfe;
  color: #11243a;
  font-size: 1rem;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.login-form__control input:focus {
  outline: none;
  border-color: #27677c;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 103, 124, 0.14);
}

.login-form__error {
  margin-bottom: 0;
  border-radius: 10px;
  font-size: 0.9rem;
}

.login-form__submit {
  width: 100%;
  min-height: 2.9rem;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 10px;
  background: #15324e;
  color: #fff;
  font-weight: 800;
}

.login-form__submit:hover,
.login-form__submit:focus {
  background: #0f273f;
  color: #fff;
}

.shell-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(17, 36, 58, 0.08);
  border-radius: 32px;
  box-shadow: var(--shell-shadow);
}

.shell-title {
  max-width: 10em;
  line-height: 1.05;
}

.shell-subtitle {
  max-width: 40rem;
  color: var(--shell-muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--shell-accent);
  font-weight: 800;
}

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.project-card {
  display: block;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.project-card:hover,
.doc-tree__page:hover {
  transform: translateY(-2px);
}

.project-card__meta {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-muted);
  margin-bottom: 0.5rem;
}

.project-toast-stack {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: grid;
  gap: 0.75rem;
  width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.project-toast {
  margin: 0;
  border: 1px solid rgba(20, 83, 45, 0.18);
  border-radius: 8px;
  background: #14532d;
  color: #fff;
  box-shadow: 0 16px 40px rgba(17, 36, 58, 0.18);
  animation: projectToastAutoHide 3s ease forwards;
  pointer-events: auto;
}

.local-editor-download {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 35;
  display: grid;
  gap: 0.35rem;
  justify-items: start;
}

.local-editor-download__button {
  min-width: 12rem;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(17, 36, 58, 0.18);
  font-weight: 800;
}

.local-editor-download__meta {
  margin: 0;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.project-list-page.is-project-import-dragover {
  outline: 2px solid rgba(20, 83, 45, 0.38);
  outline-offset: 0.5rem;
}

.project-import-form {
  margin-bottom: 1.5rem;
}

.project-import-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(17, 36, 58, 0.44);
  pointer-events: none;
}

.project-import-drop-overlay[hidden] {
  display: none !important;
}

.project-import-drop-overlay__panel {
  display: grid;
  gap: 0.25rem;
  width: min(24rem, 100%);
  padding: 1.5rem;
  border: 2px dashed rgba(20, 83, 45, 0.42);
  border-radius: 8px;
  background: #ffffff;
  color: var(--shell-ink);
  text-align: center;
  box-shadow: 0 24px 70px rgba(17, 36, 58, 0.24);
}

.project-import-drop-overlay__panel strong {
  font-size: 1.05rem;
}

.project-import-drop-overlay__panel span {
  color: var(--shell-muted);
  font-size: 0.86rem;
}

.project-data-modal__card {
  width: min(92rem, calc(100vw - 2rem));
}

.project-data-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-data-modal textarea {
  min-height: 28rem;
  resize: vertical;
  font-family: var(--bulma-family-code, monospace);
  font-size: 0.86rem;
  line-height: 1.5;
}

@media screen and (max-width: 1023px) {
  .project-data-modal__grid {
    grid-template-columns: 1fr;
  }

  .project-data-modal textarea {
    min-height: 16rem;
  }
}

@keyframes projectToastAutoHide {
  0%,
  82% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  100% {
    opacity: 0;
    transform: translateY(0.5rem);
    visibility: hidden;
  }
}

.workspace-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.25rem;
}

.workspace-sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  max-height: calc(100vh - 3rem);
  overflow: auto;
}

.workspace-sidebar__inner {
  padding: 1.25rem;
}

.workspace-panel,
.workspace-editor {
  min-width: 0;
}

.workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-tree {
  display: grid;
  gap: 1rem;
}

.doc-tree__section {
  padding: 0.9rem 0;
  border-top: 1px solid rgba(17, 36, 58, 0.08);
}

.doc-tree__section:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-tree__section-title {
  margin-bottom: 0.55rem;
  font-weight: 700;
}

.doc-tree__group {
  margin-left: 0.35rem;
  padding-left: 0.8rem;
  border-left: 2px solid rgba(20, 83, 45, 0.12);
}

.doc-tree__group + .doc-tree__group {
  margin-top: 0.85rem;
}

.doc-tree__group-title {
  font-size: 0.82rem;
  color: var(--shell-muted);
  margin-bottom: 0.5rem;
}

.doc-tree__page {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  color: inherit;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.doc-tree__page.is-active {
  background: linear-gradient(135deg, #15324e, #27677c);
  color: #fff;
}

.workspace-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.element-zone {
  display: grid;
  gap: 0.85rem;
}

.element-chip {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(17, 36, 58, 0.08);
  background: linear-gradient(180deg, rgba(250, 251, 247, 0.96), rgba(255, 255, 255, 1));
}

.element-chip__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.preview-shell {
  overflow-x: auto;
  padding-bottom: 1rem;
}

.theme-pill {
  display: inline-flex;
  margin: 0 0.4rem 0.4rem 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef7f0;
  color: #14532d;
  font-size: 0.8rem;
}

.a4-page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: var(--page-padding);
  background: var(--page-background);
  color: var(--shell-ink);
  box-shadow: 0 18px 54px rgba(17, 36, 58, 0.18);
  font-family: var(--font-family);
}

.a4-page__header,
.a4-page__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.a4-page__title {
  color: var(--title-color);
  font-size: 1.8rem;
  margin: 0;
}

.a4-page__section {
  margin-top: 0.45rem;
  color: var(--shell-muted);
}

.a4-page__eyebrow {
  margin-bottom: 0.35rem;
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.a4-page__meta {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  text-align: right;
}

.a4-page__common {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.1rem;
}

.a4-page__body {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}

.a4-row {
  display: block;
}

.a4-layout {
  display: grid;
  gap: 1rem;
}

.a4-layout__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.a4-layout__grid--single {
  grid-template-columns: 1fr;
}

.a4-layout__primary,
.a4-layout__secondary,
.a4-layout__top,
.a4-layout__bottom {
  display: grid;
  gap: 1rem;
}

.a4-layout--title_two_text_boxes .a4-layout__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.a4-layout--title_table .a4-layout__bottom .a4-element--table {
  padding: 0.9rem 1rem;
}

.a4-layout--title_mermaid .a4-layout__secondary .a4-element,
.a4-layout--title_text_image .a4-layout__secondary .a4-element {
  min-height: 100%;
}

.a4-element {
  border: 1px solid rgba(17, 36, 58, 0.08);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.9), rgba(255, 255, 255, 1));
}

.a4-element--common {
  background: linear-gradient(135deg, #eef7f0, #fffdf7);
}

.a4-element h1,
.a4-element h2,
.a4-element h3 {
  color: var(--title-color);
}

.rendered-title.is-overflowing,
.rendered-markdown.is-overflowing {
  outline: 2px dashed #f59e0b;
  outline-offset: 6px;
}

.image-placeholder {
  min-height: 140px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e7f1ea 0%, #fff3df 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder__inner {
  padding: 1rem;
  text-align: center;
  color: #40566f;
}

.table-shell table {
  width: 100%;
}

.a4-overflow-flag {
  margin-top: 1rem;
}

@media (max-width: 1023px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
    max-height: none;
  }

  .a4-layout__grid,
  .a4-layout--title_two_text_boxes .a4-layout__grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .shell-nav,
  .workspace-sidebar,
  .button,
  .a4-overflow-flag {
    display: none !important;
  }

  .shell-main,
  .section {
    padding: 0 !important;
  }

  .preview-shell {
    overflow: visible;
  }

  .a4-page {
    box-shadow: none;
    margin: 0;
    page-break-after: always;
  }
}
