@font-face {
  font-family: LocalNoto;
  src: local("Noto Sans CJK KR");
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: LocalNoto, "Noto Sans CJK KR", Arial, sans-serif;
  background: #f4f6f9;
  color: #202533;
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  background: white;
  color: #2d354a;
  border: 1px solid #d7dce7;
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 600;
  transition: 0.15s;
}
button:hover {
  background: #eaecf2;
  border-color: #a1acc6;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: #25314f;
  color: white;
  border-color: #25314f;
}
button.primary:hover {
  background: #17223d;
}
button.dark {
  background: #202533;
  color: white;
}
button.small {
  padding: 7px 10px;
  font-size: 12px;
}
button.ghost {
  background: transparent;
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
select {
  border: 1px solid #d1d6e3;
  background: white;
  border-radius: 8px;
  padding: 11px 13px;
  outline: none;
}
input:focus {
  border-color: #596992;
  box-shadow: 0 0 0 3px #59699218;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #6e7fab;
  outline-offset: 2px;
}
.logo {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo b {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.5px;
  color: #7585ab;
}
.mark {
  width: 32px;
  height: 32px;
  background: #232e4b;
  color: #b5c5ec;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 23px;
  letter-spacing: -4px;
  padding-right: 4px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  background: #fff;
  border-right: 1px solid #dee2eb;
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
}
.sidebar .logo {
  margin-bottom: 44px;
}
.side-caption {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #8492b4;
  margin: 24px 12px 12px;
}
.nav-item {
  padding: 13px;
  border: 0;
  background: transparent;
  text-align: left;
  margin-bottom: 5px;
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: #5c6c95;
}
.nav-item.active {
  background: #e8ebf3;
  color: #2b3653;
}
.nav-item span {
  font-size: 18px;
}
.sidebar-bottom {
  margin-top: auto;
}
.local-badge {
  border: 1px solid #d5dae5;
  border-radius: 12px;
  padding: 15px;
  background: #f4f6fa;
  line-height: 1.8;
  font-size: 11px;
  color: #5a6b94;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #52679c;
  border-radius: 50%;
  margin-right: 6px;
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  font-size: 12px;
}
.avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #dfe3ed;
  display: grid;
  place-items: center;
  color: #3f4a67;
  font-weight: 800;
}
.account small {
  display: block;
  color: #818fb1;
  font-size: 10px;
  margin-top: 2px;
}
.account button {
  margin-left: auto;
}
.main {
  margin-left: 228px;
  padding: 0 46px 40px;
}
.topline {
  height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfe2eb;
  color: #6b7ca5;
  font-size: 12px;
}
.search {
  width: 270px;
  background: transparent;
  font-size: 12px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 37px 0 27px;
}
.eyebrow {
  font-size: 10px;
  color: #5d6e99;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.intro h1 {
  font-size: 29px;
  letter-spacing: -1.1px;
  font-weight: 700;
}
.muted {
  color: #7585ab;
  font-size: 12px;
  line-height: 1.8;
}
.intro p {
  margin-top: 10px;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  border: 1px solid #d5dae6;
  border-radius: 17px;
  background: #e0e5f0;
  min-height: 239px;
  margin-bottom: 35px;
}
.hero-copy {
  padding: 31px 35px;
}
.pill {
  display: inline-block;
  padding: 5px 9px;
  background: #c9d1e6;
  color: #425072;
  border-radius: 5px;
  font-size: 10px;
  margin-bottom: 14px;
}
.hero h2 {
  font-size: 24px;
  line-height: 1.45;
  letter-spacing: -0.8px;
  margin-bottom: 11px;
}
.hero p {
  font-size: 12px;
  line-height: 1.8;
  color: #5f709a;
  margin-bottom: 20px;
}
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #cdd4e6, transparent);
  min-height: 230px;
}
.mini-slide {
  width: 79%;
  aspect-ratio: 16/9;
  background: #fafbfc;
  border-top: 6px solid #345ab5;
  box-shadow: 0 12px 30px #232d4616;
  transform: rotate(-5deg);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}
.mini-slide strong {
  font-size: 18px;
  text-align: center;
  color: #222;
  line-height: 1.5;
}
.mini-slide small {
  color: #345dbd;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 600;
}
.mini-slide em {
  position: absolute;
  bottom: 10px;
  right: 15px;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  color: #35488b;
}
.floating {
  position: absolute;
  bottom: 27px;
  right: 25px;
  background: white;
  padding: 9px 13px;
  box-shadow: 0 5px 20px #222b4312;
  border-radius: 7px;
  font-size: 10px;
  color: #55648a;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 20px;
}
.section-head h2 {
  font-size: 17px;
}
.filters {
  display: flex;
  gap: 8px;
}
.filters button {
  font-size: 11px;
  padding: 7px 12px;
}
.filters button.selected {
  background: #29334d;
  color: white;
  border-color: #29334d;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 22px;
}
.card {
  border: 1px solid #dbdfe9;
  border-radius: 13px;
  background: white;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px #22293b10;
  border-color: #a4afc8;
}
.preview {
  height: 174px;
  background: #e8ebf1;
  padding: 19px;
  display: grid;
  place-items: center;
  position: relative;
}
.preview img {
  max-height: 100%;
  max-width: 100%;
  box-shadow: 0 3px 10px #20263514;
}
.preview .file-icon {
  font-size: 43px;
  color: #6375a0;
}
.card-content {
  padding: 18px;
}
.card h3 {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  color: #8391b3;
  font-size: 10px;
}
.type-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #ffffffdf;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #54648a;
}
.empty {
  padding: 50px 25px;
  background: #fff;
  border: 1px dashed #d1d6e2;
  border-radius: 13px;
  text-align: center;
  grid-column: 1/-1;
}
.empty h3 {
  margin-bottom: 10px;
}
.footer-note {
  font-size: 10px;
  color: #8f9cbb;
  margin-top: 35px;
  display: flex;
  justify-content: space-between;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: #212a3f;
  color: #e5eaf5;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand .logo b {
  color: #b5bdd1;
}
.auth-brand h1 {
  font-size: 48px;
  line-height: 1.4;
  letter-spacing: -2px;
}
.auth-brand p {
  color: #a2acc6;
  line-height: 1.9;
  margin-top: 24px;
}
.auth-brand small {
  color: #7685ab;
}
.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 30px;
}
.auth-form {
  width: min(380px, 100%);
}
.auth-form h2 {
  font-size: 28px;
  margin-bottom: 10px;
}
.auth-form form {
  margin-top: 35px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 20px;
  font-size: 12px;
}
.field input {
  padding: 13px;
}
.auth-form .primary {
  width: 100%;
  padding: 14px;
}
.auth-switch {
  text-align: center;
  margin-top: 25px;
  font-size: 12px;
  color: #6a7aa3;
}
.auth-switch button {
  font-size: 12px;
  color: #35405d;
}
.form-error {
  color: #b44835;
  font-size: 12px;
  min-height: 20px;
  margin-bottom: 10px;
}
.editor-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-header {
  height: 65px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
  background: white;
  border-bottom: 1px solid #d8dce7;
}
.editor-title {
  min-width: 130px;
  max-width: 380px;
  flex: 1;
}
.editor-title input {
  width: 100%;
  border: 0;
  padding: 4px;
  font-size: 13px;
  font-weight: 600;
}
.save-status {
  font-size: 10px;
  color: #6375a0;
  padding-left: 4px;
}
.toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
}
.toolbar button {
  font-size: 11px;
  padding: 8px 11px;
}
.mode-tabs {
  display: flex;
  gap: 4px;
  background: #e9ecf2;
  border-radius: 8px;
  padding: 3px;
}
.mode-tabs button {
  border: 0;
  background: transparent;
  padding: 7px 11px;
}
.mode-tabs button.active {
  background: white;
  box-shadow: 0 1px 4px #0001;
}
.editor-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #e5e8ef;
}
.office-host {
  position: absolute;
  inset: 0;
}
.viewer {
  display: flex;
  height: 100%;
}
.thumbs {
  width: 180px;
  flex-shrink: 0;
  background: #f4f5f8;
  border-right: 1px solid #d5dae5;
  overflow: auto;
  padding: 19px 16px;
}
.thumb {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 6px;
  margin-bottom: 14px;
  display: block;
  border-radius: 4px;
}
.thumb canvas {
  width: 100%;
  height: auto;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px #0001;
  display: block;
}
.thumb.active canvas {
  border-color: #415074;
}
.thumb small {
  display: block;
  text-align: center;
  font-size: 9px;
  color: #6b7ca5;
  margin-top: 5px;
}
.stage {
  flex: 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 35px;
}
.stage-heading {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 23px;
  font-size: 11px;
  color: #6b7ba4;
}
.stage-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.stage canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 6px 25px #242d4220;
  background: white;
}
.viewer-footer {
  height: 42px;
  background: #fff;
  border-top: 1px solid #dadee8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 11px;
}
.viewer-footer input {
  width: 60px;
  padding: 4px 6px;
  text-align: center;
}
.editor-bottom {
  height: 27px;
  background: #fff;
  padding: 5px 18px;
  font-size: 10px;
  color: #7887ac;
  border-top: 1px solid #dadee8;
  display: flex;
  justify-content: space-between;
}
.loading {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #6576a0;
}
.loading p {
  margin-top: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #ced3e1;
  border-top-color: #495980;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
dialog {
  border: 1px solid #d1d6e2;
  border-radius: 17px;
  padding: 30px;
  width: min(520px, 94vw);
  box-shadow: 0 30px 90px #14192525;
  color: #293042;
}
dialog::backdrop {
  background: #171c2866;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
dialog p {
  margin-bottom: 20px;
}
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.dropzone {
  border: 1px dashed #abb4cb;
  padding: 25px;
  border-radius: 10px;
  background: #f2f4f8;
  text-align: center;
}
.dropzone input {
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
}
.version {
  padding: 14px 0;
  border-bottom: 1px solid #dde1ea;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.version small {
  color: #7382a9;
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 13px 22px;
  border-radius: 10px;
  background: #232b3e;
  color: white;
  font-size: 12px;
  transition: 0.2s;
  z-index: 10000;
  box-shadow: 0 6px 25px #0002;
  max-width: 90vw;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
}
.error-note {
  color: #b54d35;
}
.notice {
  padding: 9px 16px;
  background: #f5f0df;
  color: #8a7548;
  font-size: 10px;
}
.download-options {
  display: grid;
  gap: 10px;
}
.download-options button {
  text-align: left;
}
.download-options small {
  display: block;
  color: #6a7ba4;
  font-size: 10px;
  margin-top: 5px;
}
.fullscreen .thumbs,
.fullscreen .stage-heading {
  display: none;
}
.fullscreen .stage {
  padding: 10px;
  background: #12161e;
}
.mobile-only {
  display: none;
}
@media (max-width: 1050px) {
  .main {
    padding: 0 24px 30px;
  }
  .sidebar {
    width: 190px;
    padding: 25px 15px;
  }
  .main {
    margin-left: 190px;
  }
  .hero-copy {
    padding: 25px;
  }
  .toolbar button {
    padding: 7px;
  }
  .editor-title {
    max-width: 220px;
  }
  .editor-header {
    gap: 8px;
    padding: 0 10px;
  }
}
@media (max-width: 750px) {
  .sidebar {
    width: 65px;
    padding: 20px 9px;
  }
  .sidebar .logo {
    font-size: 0;
    gap: 0;
  }
  .sidebar .logo b,
  .nav-item label,
  .side-caption,
  .local-badge,
  .account > div:not(.avatar),
  .account button {
    display: none;
  }
  .nav-item {
    padding: 10px;
  }
  .main {
    margin-left: 65px;
    padding: 0 17px 30px;
  }
  .topline {
    height: 70px;
  }
  .search {
    width: 160px;
  }
  .intro {
    align-items: flex-start;
    gap: 10px;
  }
  .intro h1 {
    font-size: 22px;
  }
  .intro .primary {
    font-size: 11px;
    padding: 9px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    display: none;
  }
  .hero h2 {
    font-size: 21px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    padding: 30px;
    min-height: 240px;
  }
  .auth-brand h1 {
    font-size: 27px;
    margin-top: 30px;
  }
  .auth-brand p,
  .auth-brand small {
    display: none;
  }
  .auth-form-wrap {
    padding: 35px 25px;
  }
  .editor-header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px;
  }
  .editor-header .logo {
    display: none;
  }
  .editor-title {
    max-width: none;
  }
  .toolbar {
    width: 100%;
    justify-content: center;
  }
  .thumbs {
    width: 105px;
    padding: 10px 5px;
  }
  .stage {
    padding: 15px 10px;
  }
  .stage-heading {
    font-size: 9px;
  }
  .footer-note {
    display: block;
    line-height: 2;
  }
  .editor-bottom {
    font-size: 8px;
  }
}
.template-original {
  width: 82%;
  height: auto;
  box-shadow: 0 12px 30px #232d4616;
  transform: rotate(-5deg);
}
/* Keep the editor sized and alive while the preview is in front. */
.editor-body { position: relative; isolation: isolate; }
.workspace-pane { position: absolute; inset: 0; min-width: 0; min-height: 0; background: #f1f2f6; z-index: 1; }
.workspace-pane.inactive { visibility: hidden; opacity: 0; pointer-events: none; z-index: 0; }
.workspace-pane.refreshing::after { content: '최신 저장본 준비 중…'; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 10px 18px; background: #181d2b; color: white; border-radius: 12px; z-index: 3; }
.editor-loading { position: absolute; inset: 0; display: grid; place-content: center; background: #f1f2f6; z-index: 2; }
.editor-loading[hidden] { display: none; }
.auth-project { background: #eef0f5; padding: 16px 18px; border-radius: 14px; margin-bottom: 24px; }
.auth-project .field { margin-bottom: 10px; }
.auth-project strong { color: #313c57; font-size: 15px; }
.student-label { font-size: 13px; font-weight: 700; color: #313c57; margin-bottom: 8px; }
[hidden] { display: none !important; }
.field select,#class-filter{font:inherit;color:inherit;background:#fff;border:1px solid #d9dfe8;border-radius:10px;padding:12px;width:100%;box-sizing:border-box}.filters #class-filter{width:auto;padding:8px 12px}
.signup-guide ol{padding-left:24px;margin:24px 0}.signup-guide li{margin:18px 0}.signup-guide li p{font-size:15px;margin:6px 0;line-height:1.6}.signup-guide h1{font-size:clamp(30px,3vw,46px)}

/* FairX signature blue, sampled from the supplied original logo. */
:root{--fairx-blue:#0049ff;--fairx-hover:#003bd1;--fairx-tint:#edf3ff;--fairx-ink:#13234a}
.logo{gap:12px;letter-spacing:0;flex-shrink:0}
.logo img{display:block;width:132px;height:auto;object-fit:contain}
.logo b{color:#526487;font-weight:600;letter-spacing:0}
.auth-brand{background:linear-gradient(145deg,#f3f7ff,#e2ebff);color:var(--fairx-ink)}
.auth-brand .logo img{width:190px}
.auth-brand .logo b,.auth-brand p,.auth-brand small{color:#435b89}
button.primary,button.dark,.filters button.selected{background:var(--fairx-blue);border-color:var(--fairx-blue);color:#fff}
button.primary:hover,button.dark:hover,.filters button.selected:hover{background:var(--fairx-hover);border-color:var(--fairx-hover)}
.nav-item.active{background:var(--fairx-tint);color:var(--fairx-blue)}
input:focus,select:focus{border-color:var(--fairx-blue);box-shadow:0 0 0 3px #0049ff20}
button:focus-visible,a:focus-visible{outline-color:var(--fairx-blue)}
.mode-tabs button.active{color:var(--fairx-blue);background:#fff}
.hero{background:#edf3ff;border-color:#d5e1ff}
.pill{background:#dce7ff;color:#1745a3}
.eyebrow,.student-label{color:#2857b5}
button.danger{color:#b42332;border-color:#efcad0}
@media(max-width:800px){.logo img{width:106px}.auth-brand .logo img{width:150px}}

.teacher-filters{display:flex;flex-wrap:wrap;align-items:end;gap:14px;margin:18px 0 24px}.teacher-filters label{display:grid;gap:7px;color:#435b89;font-size:13px}.teacher-filters select,.teacher-filters input{min-width:140px}.date-group{grid-column:1/-1;color:#13234a;margin:14px 0 0;font-size:18px}.date-group small{font-size:12px;color:#64748b;font-weight:400;margin-left:8px}

.settings-page{max-width:760px;margin:40px auto;padding:24px;display:grid;gap:24px}.settings-page #settings-back{justify-self:start}.settings-page form{background:white;padding:24px;border:1px solid #dce5fa;border-radius:16px}.settings-page ul{list-style:none;padding:0}.settings-page li{padding:14px 18px;background:white;border-bottom:1px solid #e4ebfa}

#office-editor{width:100%;height:100%;min-height:0}
