:root {
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #13252a;
  background: #eef4f5;
}

* { box-sizing: border-box; min-width: 0; }

body { margin: 0; min-width: 320px; overflow-x: hidden; }

.app { width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 18px 48px; }

header { margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: #075f5a; font-weight: 800; font-size: 1rem; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.2; }
.intro { margin: 10px 0 0; font-size: 1.15rem; color: #30464d; }

.editor, .documents { background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 4px 18px #28434a12; }
.documents { margin-top: 20px; }
h2 { font-size: 1.45rem; margin: 0 0 20px; }
label { display: block; margin: 18px 0 8px; font-size: 1.1rem; font-weight: 700; }
input, textarea { width: 100%; border: 2px solid #6c7e84; border-radius: 12px; padding: 14px; font: inherit; font-size: 1.1rem; color: inherit; background: #fff; }
input:focus, textarea:focus { outline: 3px solid #67c7bd; border-color: #075f5a; }
textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
button { min-height: 64px; border: 0; border-radius: 14px; padding: 12px 16px; background: #075f5a; color: #fff; font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; }
button:hover { background: #034a46; }
button:focus-visible { outline: 4px solid #8ad8d1; outline-offset: 2px; }
button.secondary { background: #dce7e8; color: #17383a; border: 2px solid #587176; }
button.secondary:hover { background: #cadadc; }
.message { min-height: 1.5em; margin: 14px 0 0; color: #0b625b; font-size: 1.05rem; font-weight: 700; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; }
#document-count { color: #4a5b64; font-size: 1.05rem; }
.empty-message { margin: 18px 0 0; color: #66767c; font-size: 1.1rem; }
.document-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.document-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.document-list .open-document { width: 100%; min-height: 76px; text-align: left; background: #e9f5f3; color: #132f31; border: 2px solid #78aaa6; }
.document-list .open-document:hover { background: #d9ece9; border-color: #287b74; }
.delete-button { min-width: 82px; min-height: 76px; padding: 10px; background: #a42222; color: #fff; border: 2px solid #751414; }
.delete-button:hover { background: #801515; }
.danger { background: #a42222; }
.danger:hover { background: #801515; }
.delete-dialog { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; background: #15282b8c; }
.delete-dialog[hidden] { display: none; }
.dialog-card { width: min(100%, 430px); padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 12px 32px #0004; }
.dialog-card h2 { margin-bottom: 10px; }
.dialog-card p { margin: 0; color: #30464d; font-size: 1.05rem; line-height: 1.5; }
.document-list strong, .document-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list strong { font-size: 1.15rem; }
.document-list span { margin-top: 5px; font-size: .95rem; font-weight: 400; color: #52666a; }

@media (max-width: 420px) {
  .app { padding: 22px 12px 36px; }
  .editor, .documents { padding: 18px; border-radius: 16px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  input, textarea { font-size: 1rem; }
  .actions { grid-template-columns: 1fr; }
  .document-item { grid-template-columns: 1fr; }
  .delete-button { min-height: 58px; }
  .dialog-card { padding: 20px; }
}
