:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: #19263c;
  background: #f6f7fa;
  font-synthesis: none;
  --navy: #142238;
  --yellow: #ffda61;
  --muted: #59677a;
  --line: #dce2eb;
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
:focus-visible { outline: 3px solid #3663a9; outline-offset: 3px; }
[hidden] { display: none !important; }
.app { height: 100dvh; display: grid; grid-template-columns: 17rem minmax(0, 1fr); }
.sidebar { display: flex; min-height: 0; flex-direction: column; padding: 1.5rem 1.1rem 1.1rem; background: var(--navy); color: #f5f7fc; }
.brand { display: flex; gap: .7rem; align-items: center; margin: 0 .3rem 1.7rem; font-size: 1.1rem; font-weight: 750; }
.brand-mark { background: var(--yellow); color: var(--navy); border-radius: .6rem; display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; font-weight: 900; font-size: 1.1rem; }
.new-chat, .logout { text-align: left; background: none; color: inherit; border: 0; border-radius: .65rem; padding: .65rem .75rem; min-height: 2.75rem; }
.new-chat { background: #263852; font-weight: 650; }
.new-chat:hover, .logout:hover { background: #304564; }
.new-chat span { margin-right: .3rem; color: var(--yellow); }
.history { flex: 1; overflow: auto; margin-top: 1.65rem; }
.history h2, .history > p { font-size: .86rem; color: #b5c1d4; margin: .3rem .65rem .7rem; }
.history ul { list-style: none; padding: 0; margin: 0; }
.thread { display: block; width: 100%; text-align: left; color: inherit; padding: .66rem .7rem; border: 0; border-radius: .6rem; background: transparent; }
.thread:hover, .thread[aria-current="true"] { background: #293c58; }
.thread strong, .thread time { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread strong { font-size: .92rem; font-weight: 600; }
.thread time { color: #b5c1d4; font-size: .81rem; margin-top: .23rem; }
.logout { margin-top: .6rem; color: #dce5f4; font-size: .9rem; }
main { display: grid; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar { background: #fff; min-height: 4.15rem; padding: .65rem clamp(1rem, 4vw, 2.5rem); display: flex; align-items: center; gap: .8rem; border-bottom: 1px solid var(--line); }
.topbar p { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 720; }
.menu { color: var(--muted); border: 1px solid var(--line); background: #fff; border-radius: .55rem; min-height: 2.55rem; padding: .45rem .65rem; font-size: .88rem; }
.menu { display: none; }
.conversation { overflow: auto; }
.welcome { min-height: 100%; max-width: 52rem; margin: auto; padding: 2rem 1.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-mark { height: 3.7rem; width: 3.7rem; font-size: 2rem; border-radius: 1.1rem; margin-bottom: 1.2rem; box-shadow: 0 8px 24px #c2972626; }
.welcome h1 { font-size: clamp(1.65rem, 4vw, 2.55rem); letter-spacing: -.055em; }
.welcome p { color: var(--muted); margin-top: .55rem; line-height: 1.6; }
.suggestions { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1.85rem; }
.suggestions button { text-align: left; color: inherit; padding: .85rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: .8rem; }
.suggestions button:hover { border-color: #a8801a; background: #fffcf1; }
.suggestions strong, .suggestions span { display: block; }
.suggestions span { color: var(--muted); font-size: .91rem; margin-top: .26rem; }
.messages { max-width: 49rem; margin: auto; padding: 1.6rem 1.15rem; display: grid; gap: 1.25rem; }
.message { max-width: min(100%, 43rem); display: flex; align-items: flex-start; gap: .55rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.68; padding: .72rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: .8rem; }
.message a { color: #185b9d; }
.message.user { justify-self: end; max-width: 85%; }
.message.user .message-body { border-color: #f6e2a7; background: #fff2c5; }
.message.pending { color: var(--muted); }
.message .brand-mark { margin-top: .2rem; }
.composer { width: min(100%, 49rem); margin: auto; padding: .35rem 1.15rem max(1rem, env(safe-area-inset-bottom)); }
.composer form { display: flex; align-items: flex-end; gap: .55rem; border: 1px solid #c5cfde; border-radius: .9rem; padding: .45rem; background: #fff; box-shadow: 0 5px 20px #2837540a; }
.composer textarea { resize: none; flex: 1; min-width: 0; max-height: 9rem; min-height: 2.65rem; field-sizing: content; border: 0; border-radius: .45rem; background: transparent; padding: .6rem .65rem; color: inherit; line-height: 1.5; }
.primary { color: #19263c; background: var(--yellow); border: 0; border-radius: .6rem; padding: .62rem .9rem; min-height: 2.65rem; font-weight: 750; flex-shrink: 0; }
.primary:hover { background: #ffcf3d; }
.error { color: #a91e35; font-size: .9rem; }
.error:not(:empty) { margin: .25rem 0 .55rem; }
.signin { display: grid; min-height: 100dvh; place-items: center; padding: 1.2rem; }
.login-card { width: min(100%, 25rem); padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 1.1rem; display: grid; gap: .7rem; }
.login-card h1 { margin-top: .4rem; }
.login-card > p:not(.error) { color: var(--muted); margin-bottom: .5rem; }
.login-card label { font-size: .94rem; font-weight: 650; }
.login-card input { border: 1px solid #c5cfde; border-radius: .55rem; padding: .65rem; min-width: 0; }
dialog { border: 1px solid var(--line); border-radius: .9rem; padding: 1.4rem; color: inherit; }
dialog::backdrop { background: #17243a72; }
dialog p { color: var(--muted); margin-top: .5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.dialog-actions button { padding: .5rem .85rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: fixed; z-index: 3; inset: 0 auto 0 0; width: min(17rem, 85%); }
  .sidebar.open { display: flex; }
  .scrim { position: fixed; z-index: 2; inset: 0; background: #17243a80; border: 0; }
  .menu { display: inline-block; }
}
@media (max-width: 500px) {
  .welcome { justify-content: flex-start; padding-top: clamp(1.3rem, 7vh, 4rem); }
  .suggestions { grid-template-columns: 1fr; gap: .5rem; margin-top: 1.3rem; }
  .suggestions button { padding: .65rem .8rem; }
}
.notice-detail, .notice-form { width: min(100%, 38rem); }
dialog { width: min(40rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); }
.notice-detail time { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .88rem; }
.notice-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.64; margin-top: 1rem; }
.notice-body a { color: #185b9d; }
.notice-form { display: grid; gap: .55rem; }
.notice-form h2 { margin-bottom: .55rem; }
.notice-form label { font-weight: 650; }
.notice-form input:not([type="file"]), .notice-form textarea { width: 100%; padding: .6rem; border: 1px solid #c5cfde; border-radius: .55rem; color: inherit; }
.notice-form textarea { resize: vertical; }
.notice-form .file-label { color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.dialog-actions .primary { background: var(--yellow); border-color: transparent; }
.notice-focus { display: flex; align-items: center; justify-content: space-between; gap: .55rem; margin-bottom: .45rem; padding: .4rem .65rem; border-radius: .65rem; background: #fff2c5; font-size: .91rem; }
.notice-focus button { flex: none; color: inherit; border: 0; border-radius: .4rem; background: #0000000b; padding: .4rem; }
.message-context { display: block; color: #675922; margin-bottom: .3rem; font-size: .82rem; }
