:root {
  color-scheme: light;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #1e293b;
  background: #f4f6fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #2b4b9e;
  --blue-dark: #203b83;
  --blue-soft: #eaf0ff;
  --green: #34784a;
  --green-soft: #eaf5ed;
  --gold: #8b6810;
  --gold-soft: #fff7dc;
  --line: #e0e6f0;
  --muted: #69758b;
  --surface: rgba(255,255,255,.92);
  --shadow: 0 14px 38px rgba(34, 55, 98, .07);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 10% 0%, #e9efff 0, transparent 36rem), #f4f6fb; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--blue); letter-spacing: .13em; font-size: .72rem; font-weight: 800; }
h1 { margin: 8px 0 5px; font-size: clamp(1.55rem, 2.5vw, 2.2rem); letter-spacing: -.035em; }
.topbar p { margin: 0; color: var(--muted); }
.beta { display: inline-block; vertical-align: 4px; margin-left: 6px; padding: 4px 8px; border-radius: 99px; color: var(--blue); background: var(--blue-soft); font-size: .7rem; letter-spacing: 0; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(135deg, #3558b0, var(--blue)); box-shadow: 0 5px 13px rgba(43,75,158,.18); }
.button.primary:not(:disabled):hover { background: var(--blue-dark); }
.button.secondary { color: var(--blue); border-color: #d7e0f1; background: #fff; }
.button.secondary:hover { background: #f8faff; }
.privacy-note, .setup-warning, .card, .summary-tile { border: 1px solid rgba(220,227,239,.9); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.privacy-note { display: flex; align-items: center; gap: 13px; padding: 15px 18px; margin-bottom: 16px; color: #4f5c72; font-size: .9rem; line-height: 1.55; }
.privacy-note strong { color: #25344e; }
.privacy-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; background: #eef4ff; font-size: 1.05rem; }
.setup-warning { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 13px 16px; border-color: #f0df9e; background: #fffaf0; color: #715514; }
.setup-warning strong { color: #674c0c; }
.setup-warning span { flex: 1; min-width: 240px; font-size: .9rem; }
.card { padding: 22px; }
.upload-card { margin-bottom: 17px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading > div:first-child, .modal-heading > div { display: flex; align-items: center; gap: 11px; }
h2 { margin: 0; font-size: 1.13rem; letter-spacing: -.02em; }
.step { color: var(--blue); font-weight: 800; font-size: .76rem; letter-spacing: .07em; }
.muted { color: var(--muted); font-size: .83rem; }
.upload-row { display: grid; grid-template-columns: minmax(280px, 1fr) 190px auto; align-items: end; gap: 13px; }
.file-picker { position: relative; display: flex; align-items: center; min-width: 0; gap: 12px; padding: 12px 15px; border: 1px dashed #b9c8e4; border-radius: 13px; background: #fbfcff; cursor: pointer; }
.file-picker:hover { border-color: var(--blue); background: #f7f9ff; }
.file-picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-picker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker small { color: var(--muted); font-size: .75rem; }
.file-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; color: var(--blue); background: #eaf0ff; font-size: 1.4rem; }
.date-field, .filters label, .edit-grid label, .setting-row label, .note-field { display: flex; flex-direction: column; gap: 7px; color: #59667c; font-size: .8rem; font-weight: 700; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 40px; padding: 9px 11px; color: #1e293b; border: 1px solid #d8e0ed; border-radius: 9px; outline: none; background: white; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #6c86cc; box-shadow: 0 0 0 3px rgba(67,103,191,.12); }
.analyze-button { min-width: 132px; }
.progress-track { height: 3px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: #e8edfa; }
.progress-bar { width: 38%; height: 100%; border-radius: 4px; background: var(--blue); animation: progress 1.3s ease-in-out infinite alternate; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.alert { padding: 13px 16px; margin: 0 0 15px; border: 1px solid; border-radius: 12px; line-height: 1.5; }
.alert.error { color: #822b33; border-color: #efc8cb; background: #fff2f3; }
.alert.success { color: #28623c; border-color: #cce5d2; background: #eff9f1; }
.alert.compact { margin: 12px 0 0; padding: 10px 12px; font-size: .9rem; }
.summary-row { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)) minmax(220px, 2fr); gap: 12px; margin-bottom: 17px; }
.summary-tile { display: flex; flex-direction: column; justify-content: center; min-height: 82px; padding: 13px 17px; }
.summary-tile span { color: var(--muted); font-size: .8rem; }
.summary-tile strong { margin-top: 5px; font-size: 1.48rem; }
.summary-tile.summary-source strong { font-size: 1rem; }
.green-text, .student-status.done { color: var(--green); }
.gold-text, .student-status.pending { color: var(--gold); }
.work-card { padding-bottom: 16px; }
.results-heading { margin-bottom: 15px; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters { display: grid; grid-template-columns: minmax(150px, 220px) minmax(160px, 1fr) auto; align-items: end; gap: 11px; margin-bottom: 14px; padding: 13px; border-radius: 13px; background: #f6f8fc; }
.filters select, .filters input { min-height: 38px; }
.status-filters { display: flex; align-items: center; gap: 5px; padding-bottom: 1px; }
.filter-chip { min-height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 99px; color: #657188; background: transparent; white-space: nowrap; font-size: .78rem; }
.filter-chip:hover { background: white; }
.filter-chip.active { color: var(--blue); border-color: #dce5f7; background: white; box-shadow: 0 2px 6px rgba(35,55,100,.04); font-weight: 700; }
.workspace { display: grid; grid-template-columns: minmax(330px, .88fr) minmax(0, 1.12fr); min-height: 490px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.student-list { max-height: 670px; overflow: auto; border-right: 1px solid var(--line); background: #fbfcfe; }
.student-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 69px; gap: 10px; padding: 12px 15px; text-align: left; border: 0; border-bottom: 1px solid #edf0f5; background: transparent; }
.student-row:hover { background: #f3f6fc; }
.student-row.selected { border-left: 3px solid var(--blue); padding-left: 12px; background: #edf2ff; }
.student-main { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.student-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-main small { color: var(--muted); font-size: .74rem; }
.student-status { flex: 0 0 auto; font-size: .73rem; }
.preview-pane { min-width: 0; padding: 19px; background: white; }
.preview-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.preview-title h3 { margin: 0 0 4px; font-size: 1.06rem; }
.preview-title span { color: var(--muted); font-size: .77rem; }
.message-preview { min-height: 240px; margin: 0; padding: 17px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #e4e9f1; border-radius: 12px; color: #202c42; background: #fbfcfe; font: 500 .95rem/1.75 "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
.review-details { margin: 13px 2px 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.review-details strong { color: #4b596f; }
.review-details p { margin: 4px 0; overflow-wrap: anywhere; }
.review-actions { margin-top: 13px; }
.review-form { margin-top: 15px; padding: 16px; border: 1px solid #e4e9f1; border-radius: 12px; background: #fbfcff; }
.review-form h4 { margin: 0 0 13px; font-size: .98rem; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.edit-grid label { font-size: .75rem; }
.edit-grid input, .edit-grid select { min-height: 36px; }
.note-field { margin-top: 11px; font-size: .76rem; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; color: #46536a; font-size: .82rem; line-height: 1.45; }
.check-row input { accent-color: var(--blue); margin-top: 2px; }
.correction-check { color: #805f0d; }
.empty-state { display: grid; place-content: center; min-height: 180px; padding: 20px; color: #7c8799; text-align: center; font-size: .88rem; line-height: 1.6; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 3px 0; color: #7b8798; font-size: .75rem; }
.text-button { padding: 5px 2px; color: var(--blue); border: 0; background: transparent; font-size: .82rem; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(19,29,49,.42); backdrop-filter: blur(5px); }
.settings-modal { display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(92vh, 980px); padding: 22px; border: 1px solid #e4e9f3; border-radius: 18px; background: white; box-shadow: 0 28px 90px rgba(15,28,55,.24); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #637087; background: white; font-size: 1.2rem; }
.icon-button:hover { background: #f4f6fa; }
.icon-button.remove { flex: 0 0 34px; margin-top: 19px; color: #98636a; }
.settings-scroll { overflow-y: auto; padding: 6px 3px 18px 0; }
.settings-scroll h3 { margin: 19px 0 11px; font-size: .92rem; }
.setting-list { display: flex; flex-direction: column; gap: 8px; }
.setting-row { display: flex; align-items: end; gap: 9px; margin: 8px 0; }
.setting-row label { flex: 1; font-size: .74rem; }
.setting-row input { min-height: 36px; }
.settings-grid { margin-top: 14px; }
.privacy-detail { margin: 7px 0 0 25px; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.loading, .empty-page { display: grid; place-items: center; min-height: 100vh; color: var(--blue); font-weight: 700; }

@media (max-width: 1000px) {
  .shell { width: min(100% - 28px, 900px); padding-top: 22px; }
  .upload-row { grid-template-columns: 1fr 180px; }
  .analyze-button { grid-column: 1 / -1; width: 100%; }
  .filters { grid-template-columns: 1fr 1fr; }
  .status-filters { grid-column: 1 / -1; flex-wrap: wrap; }
  .workspace { grid-template-columns: 1fr; }
  .student-list { max-height: 290px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-pane { min-height: 420px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 22px); padding: 19px 0; }
  .topbar { align-items: flex-start; gap: 9px; }
  .topbar p { max-width: 270px; font-size: .84rem; line-height: 1.45; }
  .topbar > .button { min-height: 38px; padding: 0 12px; }
  .privacy-note { align-items: flex-start; padding: 12px; font-size: .8rem; }
  .setup-warning { align-items: flex-start; }
  .setup-warning .button { width: 100%; }
  .card { padding: 15px; border-radius: 15px; }
  .section-heading { align-items: flex-start; }
  .upload-row { grid-template-columns: 1fr; }
  .date-field { display: grid; grid-template-columns: 65px 1fr; align-items: center; }
  .analyze-button { grid-column: auto; }
  .summary-row { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .summary-tile { min-height: 69px; padding: 10px; }
  .summary-tile span { font-size: .7rem; }
  .summary-tile strong { font-size: 1.2rem; }
  .summary-tile.summary-source { grid-column: 1 / -1; min-height: 58px; }
  .summary-tile.summary-source strong { font-size: .9rem; }
  .results-heading { align-items: center; }
  .results-heading .button { min-height: 36px; padding: 0 10px; font-size: .75rem; }
  .filters { grid-template-columns: 1fr; padding: 10px; }
  .status-filters { grid-column: auto; }
  .filter-chip { padding: 0 8px; font-size: .72rem; }
  .workspace { min-height: 0; }
  .student-list { max-height: 245px; }
  .student-row { min-height: 61px; padding: 9px 10px; }
  .student-row.selected { padding-left: 7px; }
  .student-main small { max-width: 195px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .preview-pane { min-height: 0; padding: 13px; }
  .preview-title { align-items: flex-start; }
  .preview-title .button { min-height: 37px; padding: 0 11px; white-space: nowrap; font-size: .76rem; }
  .message-preview { min-height: 200px; padding: 13px; font-size: .88rem; }
  .edit-grid { grid-template-columns: 1fr; }
  .review-form { padding: 12px; }
  .footer { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: 8px; }
  .settings-modal { padding: 16px; max-height: 96vh; }
  .setting-row { gap: 6px; }
  .setting-row label { min-width: 0; }
  .setting-row label input { padding: 8px; font-size: .82rem; }
}
