/* ===== Word 창 내부 ===== */
:root {
  --wd-blue: #2b579a;
  --wd-blue-dim: #5a7bb0;
}

.wd-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #e6e6e6;
}

.win--word .win-titlebar {
  background: var(--wd-blue);
  color: #fff;
  border-bottom: none;
}

.win--word:not(.is-active) .win-titlebar {
  background: var(--wd-blue-dim);
  color: rgba(255, 255, 255, 0.85);
}

.win--word .win-ctrl:hover {
  background: rgba(255, 255, 255, 0.15);
}

.win--word .win-ctrl-close:hover {
  background: #e81123;
}

/* 리본 */
.wd-ribbon {
  flex: 0 0 auto;
  background: #f3f3f3;
  border-bottom: 1px solid #d6d6d6;
}

.wd-ribbon-tabs {
  display: flex;
  align-items: flex-end;
  height: 28px;
  padding-left: 4px;
  background: var(--wd-blue);
  font-size: 12px;
}

.win:not(.is-active) .wd-ribbon-tabs {
  background: var(--wd-blue-dim);
}

.wd-ribbon-tab {
  padding: 0 12px;
  height: 24px;
  line-height: 24px;
  color: #fff;
  border-radius: 3px 3px 0 0;
}

.wd-ribbon-tab-file { font-weight: 600; }

.wd-ribbon-tab.is-active {
  background: #f3f3f3;
  color: #222;
}

.wd-ribbon-body {
  display: flex;
  height: 72px;
  padding: 4px 8px 0;
  gap: 4px;
}

.wd-ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 10px;
  border-right: 1px solid #dcdcdc;
  color: #333;
}

.wd-ribbon-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.wd-font-name,
.wd-font-size {
  display: inline-block;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid #c8c8c8;
  font-size: 12px;
}

.wd-font-name { width: 130px; }
.wd-font-size { width: 44px; }

.wd-fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  color: #333;
}

.wd-style {
  display: inline-block;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #d6d6d6;
  font-size: 12px;
}

.wd-style-h {
  color: var(--wd-blue);
  font-size: 13px;
  font-weight: 600;
}

.wd-ribbon-group-label {
  font-size: 11px;
  color: #666;
  text-align: center;
  padding-bottom: 2px;
}

@media (max-width: 720px) {
  .wd-ribbon-body { display: none; }
}

/* 페이지 */
.wd-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 24px 16px;
}

.wd-page-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.wd-page {
  flex: 0 0 auto;
  width: 595px;
  min-height: 760px;
  padding: 72px 68px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #111;
  user-select: text;
  cursor: text;
}

@media (max-width: 720px) {
  .wd-page { width: 100%; padding: 32px 24px; min-height: 0; }
  .wd-page-wrap { flex-direction: column; }
}

/* 창이 페이지 + 메모 칸보다 좁으면 메모를 페이지 아래로 내린다 */
@container win (max-width: 860px) {
  .wd-page-wrap { flex-direction: column; align-items: center; }
  .wd-page { width: 100%; max-width: 595px; padding: 48px 40px; min-height: 0; }
  .wd-comments { flex: 0 0 auto; width: 100%; max-width: 595px; padding-top: 0; }
}

.wd-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
}

.wd-h {
  margin: 18px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--wd-blue);
}

.wd-p {
  margin: 0;
  white-space: pre-line;
}

.wd-li {
  position: relative;
  padding-left: 18px;
}

.wd-li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
}

.wd-blank {
  height: 1.7em;
}

.wd-align-center { text-align: center; }
.wd-align-right { text-align: right; }

/* 메모 풍선 */
.wd-comments {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 72px;
}

.wd-comment {
  padding: 8px 10px;
  background: #fff;
  border-left: 3px solid #d98c2a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  line-height: 1.5;
}

.wd-comment-by {
  font-weight: 600;
  color: #b06a10;
  margin-bottom: 2px;
}

.wd-comment-text {
  color: #333;
  white-space: pre-line;
}

/* 상태 표시줄 */
.wd-statusbar {
  flex: 0 0 auto;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 10px;
  background: var(--wd-blue);
  color: #fff;
  font-size: 11px;
}

.win:not(.is-active) .wd-statusbar {
  background: var(--wd-blue-dim);
}

.wd-status-right {
  margin-left: auto;
}
