:root {
  color-scheme: light;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #172c3d;
  background: #f2f6f7;
  --navy: #13283b;
  --ink: #172c3d;
  --muted: #536b7a;
  --line: #dce6e9;
  --teal: #087469;
  --wash: #e8f5f2;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: progress; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid #319d95; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loading, .empty { color: var(--muted); padding: 30px; margin: 0; }
.primary, .soft, .danger { border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.primary { background: var(--teal); color: white; }
.primary:hover { background: #075e55; }
.installer-link { display: inline-block; text-decoration: none; }
.soft { background: var(--wash); color: #075c53; }
.soft:hover { background: #d8efe9; }
.danger { background: #fbefec; color: #9b3f32; }
.danger:hover { background: #f9e0da; }
.icon-button { background: transparent; border: 0; color: inherit; padding: 8px; border-radius: 6px; }
.icon-button:hover { background: #52677633; }
.symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #70decb; color: #133d41; font-weight: 900; font-size: 21px; flex: 0 0 auto; }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px,46%) 1fr; }
.login-intro { background: var(--navy); color: #f5fbff; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 10%; }
.login-intro h1 { font-size: clamp(46px,6.2vw,100px); letter-spacing: -.075em; line-height: 1.16; margin: 18px 0; }
.login-intro p { color: #b8d5db; line-height: 1.75; font-size: 18px; }
.login-main { display: grid; place-items: center; padding: 32px; background: #f7faf9; }
.login-main form { width: min(390px,100%); }
.login-main h2 { font-size: 32px; letter-spacing: -.05em; margin: 0 0 28px; }
form label:not(.sr) { display: grid; gap: 7px; color: #385265; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; min-width: 0; color: var(--ink); border: 1px solid #cbdce0; border-radius: 8px; background: #fff; padding: 10px 12px; }
textarea { resize: vertical; }
input[readonly] { background: #f3f7f8; }
#login, #new-approval, #decision, #resubmit { display: grid; gap: 15px; }
#login .remember-login { display: flex; align-items: center; gap: 8px; width: fit-content; cursor: pointer; }
#login .remember-login input { width: 16px; height: 16px; accent-color: var(--teal); }
.demo { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.demo strong { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.demo div { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace { display: flex; width: 100%; min-height: 100dvh; }
.sidebar { width: 235px; display: flex; flex-direction: column; flex: 0 0 235px; padding: 22px 14px 14px; background: var(--navy); color: #e9f2f5; }
.brand, .profile { display: flex; align-items: center; gap: 10px; }
.brand { padding: 0 5px; font-weight: 800; }
.brand small, .profile small { display: block; color: #b4c8d3; font-size: 11px; font-weight: 400; margin-top: 3px; }
.chat-directory { margin: 15px 0 0; }
.chat-directory h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 6px 7px; font-size: 13px; }
.chat-directory h2 span, .chat-directory p { color: #b4c8d3; font-size: 11px; font-weight: 400; }
.chat-directory p { margin: 6px; }
.chat-directory-search { display: block; margin: 0 4px 4px; }
.chat-directory-search input { padding: 5px 8px; background: #1f394c; border-color: #436176; color: #e9f2f5; font-size: 12px; }
.chat-directory-search input::placeholder { color: #b4c8d3; }
.chat-directory-list { max-height: 132px; overflow: auto; }
.chat-directory-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 7px; color: #e9f2f5; border: 0; border-radius: 8px; background: transparent; text-align: left; overflow-wrap: anywhere; }
.chat-directory-list button:hover { background: #ffffff13; }
.chat-person-avatar { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 7px; background: #244c5a; color: #dcf7f4; font-size: 12px; font-weight: 700; }
.sidebar nav { display: grid; gap: 5px; margin: 12px 0; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { border-top: 1px solid #ffffff24; margin-top: 8px; padding-top: 8px; }
.nav-heading { color: #b4c8d3; font-size: 11px; font-weight: 700; padding: 3px 10px; }
.sidebar nav button, .sidebar nav .chat-launch, .rooms button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 41px; padding: 8px 10px; color: #d6e5ed; border: none; background: transparent; border-radius: 8px; text-align: left; }
.sidebar nav .chat-launch { text-decoration: none; justify-content: space-between; }
.sidebar nav button:hover, .sidebar nav .chat-launch:hover, .rooms button:hover { background: #ffffff13; }
.sidebar nav button[aria-current="page"] { color: #fff; background: #265365; font-weight: 800; }
.sidebar nav b { background: #8de3d4; border-radius: 12px; color: #123746; padding: 1px 6px; margin-left: auto; font-size: 12px; }
.rooms p { color: #b4c8d3; font-size: 12px; padding-left: 8px; }
.rooms .selected { background: #ffffff12; color: #fff; }
.rooms button span { color: #83c8c4; }
.profile { margin-top: auto; border-top: 1px solid #ffffff24; padding: 14px 1px 0; }
.profile .icon-button { margin-left: auto; font-size: 11px; }
.profile strong { font-size: 13px; }
.avatar { display: grid; place-items: center; background: #e5edfa; color: #354e6f; font-weight: 800; border-radius: 12px; width: 38px; height: 38px; flex: 0 0 auto; }
.profile .avatar { background: #244c5a; color: #dcf7f4; }
.main { flex: 1 1 0; min-width: 0; height: 100dvh; display: flex; flex-direction: column; background: #f7fafb; }
.main header { background: #fff; padding: clamp(16px,2.5vw,34px); gap: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.section-label { color: var(--teal); font-weight: 800; font-size: 12px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.main h1, .drawer h2 { margin: 5px 0 2px; font-size: clamp(23px,3vw,34px); letter-spacing: -.055em; }
.main h1 span { color: var(--teal); }
.main header p { color: var(--muted); font-size: 13px; margin: 7px 0 0; }
.search-label { width: min(217px,36%); }
.search-label input { background: #f5f8f9; font-size: 13px; }
.chat-content { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.thread { flex: 1; overflow: auto; overflow-anchor: none; padding: 22px clamp(14px,2.7vw,36px); }
.thread-navigation { text-align: center; padding: 10px; }
.chat-search-hit { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; width: 100%; padding: 12px; margin-bottom: 7px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chat-search-hit span, .chat-search-hit small { grid-column: 1 / -1; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-search-hit time, .chat-search-hit small { color: var(--muted); font-size: 12px; }
.message { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 19px; }
.message.mine .avatar { background: #dcf2eb; color: #0b6258; }
.message-main { min-width: 0; max-width: 100%; }
.message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.message-meta time, .file-link small, .approval-card small, .inbox-row small { color: var(--muted); font-size: 12px; }
.message-main p { margin: 0 0 7px; line-height: 1.6; white-space: pre-wrap; }
.file-card, .approval-card { display: flex; gap: 11px; align-items: center; background: white; border: 1px solid var(--line); padding: 10px; border-radius: 12px; }
.file-card { flex-wrap: wrap; }
.file-link { display: flex; align-items: center; gap: 9px; text-decoration: none; padding: 5px; border-radius: 8px; min-width: 0; }
.file-link:hover { background: #eef7f6; text-decoration: underline; }
.file-link strong { overflow-wrap: anywhere; font-size: 13px; }
.file-link small, .approval-card small, .inbox-row small { display: block; margin-top: 4px; }
.file-icon, .approval-icon { flex: 0 0 auto; display: grid; place-items: center; font-size: 18px; width: 36px; height: 36px; font-weight: 800; border-radius: 9px; background: #efebe1; color: #7c5921; }
.approval-card { margin: 12px 0; }
.approval-card>div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.approval-icon { background: var(--wash); color: var(--teal); }
.badge { display: inline-block; width: fit-content; padding: 6px 9px; border-radius: 20px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.pending { background: #fff3d8; color: #805415; }
.badge.approved { background: #dff4e9; color: #1e6549; }
.badge.returned { background: #e4eefa; color: #345682; }
.badge.rejected { background: #f9e8e3; color: #8f3e30; }
.composer { background: #fff; border: 1px solid #d3e0e4; border-radius: 13px; margin: 0 clamp(14px,2.7vw,36px) 18px; padding: 9px; }
.composer textarea { border: 0; min-height: 50px; max-height: 25vh; }
.compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 1px; }
#attached:not(:empty) { color: var(--teal); font-size: 13px; padding: 6px 8px; overflow-wrap: anywhere; }
.inbox { overflow: auto; padding: 22px clamp(14px,2.7vw,36px); }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 16px; }
.tabs button { border: 1px solid var(--line); background: white; color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.tabs button[aria-pressed="true"] { background: var(--wash); color: var(--teal); font-weight: 800; }
.approval-tabs button span { display: inline-block; min-width: 1.65em; margin-left: 4px; border-radius: 99px; padding: 1px 5px; text-align: center; font-size: .8em; background: #dce9ed; color: #355363; }
.approval-tabs button[aria-pressed="true"] span { background: #c6ebe3; color: #07564f; }
.approval-list { display: grid; gap: 8px; }
.inbox-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 12px; color: var(--ink); text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 13px; }
.inbox-row strong { overflow-wrap: anywhere; }
.inbox-row:hover { border-color: #68a9a4; }
.drawer { width: min(400px,39%); flex: 0 0 auto; height: 100dvh; overflow: auto; border-left: 1px solid var(--line); background: #fff; padding: 21px 22px; }
.drawer-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.drawer .close { font-size: 25px; line-height: 1; }
.drawer h2 { font-size: 25px; }
.drawer h3 { font-size: 15px; margin: 22px 0 9px; }
.drawer dl { margin: 16px 0; }
.drawer dl div { display: grid; grid-template-columns: 80px 1fr; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #e8eff1; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; font-weight: 700; }
.drawer .file-link { border: 1px solid var(--line); padding: 8px; }
.document-text { white-space: pre-wrap; margin: 0 0 15px; font-size: 14px; line-height: 1.65; }
.decision-bar { display: flex; flex-wrap: wrap; gap: 7px; }
.decision-bar button { padding-inline: 11px; }
.history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.history li { padding: 9px 1px; display: flex; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 12px; }
.history li span { color: var(--muted); text-align: right; }
.toast { position: fixed; z-index: 3; bottom: 16px; left: 50%; transform: translateX(-50%); border-radius: 9px; background: #164d4b; color: #fff; max-width: calc(100% - 28px); padding: 11px 16px; box-shadow: 0 5px 18px #0003; }
.toast.bad { background: #8f3d30; }
dialog { width: min(420px,calc(100% - 30px)); padding: 24px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
dialog::backdrop { background: #13283b70; }
dialog h2 { margin: 0; font-size: 22px; }
dialog p { color: var(--muted); line-height: 1.5; }
.sidebar { height: 100dvh; min-height: 0; }
.sidebar nav { flex-shrink: 0; }
.rooms { min-height: 0; display: flex; flex-direction: column; margin-bottom: 10px; }
.rooms-heading { display: flex; align-items: center; justify-content: space-between; }
.rooms-heading .icon-button { width: auto; min-height: 30px; }
#rooms { overflow: auto; }
#rooms button { overflow-wrap: anywhere; }
.room-sort { padding: 0 6px 7px; flex-shrink: 0; }
.room-sort select { padding: 5px 8px; background: #1f394c; border-color: #436176; color: #e9f2f5; font-size: 12px; }
.people-search { display: grid; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.removed-message { color: var(--muted); font-size: 12px; font-style: italic; padding-left: 48px; }
.removed-message p { margin: 0; }
[data-retained]:empty { display: none; }
[data-retained], #attached:not(:empty) { align-items: center; }
[data-retained] { display: flex; gap: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.unread { margin-left: auto; background: #8de3d4; color: #123746; padding: 2px 6px; min-width: 21px; border-radius: 10px; text-align: center; font-size: 11px; }
.header-actions { display: flex; align-items: center; min-width: 0; gap: 8px; }
.header-actions .search-label { width: 190px; max-width: 100%; }
.header-actions .soft { font-size: 13px; }
.chat-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px clamp(14px,2.7vw,36px); background: #e4f2ef; border-bottom: 1px solid #d3e7e3; font-size: 13px; }
.pin-link { border: 0; background: none; display: flex; align-items: center; gap: 12px; color: var(--ink); text-align: left; min-width: 0; padding: 5px 0; }
.pin-link strong { color: var(--teal); }
.pin-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message.read, .message-read { color: var(--teal); font-size: 11px; }
.message.highlighted { background: #daf1ed; border-radius: 8px; }
.message-actions, .reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.message-actions button, .reactions button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 5px; font-size: 11px; padding: 3px 6px; }
.message-actions button:hover, .reactions button:hover, .reactions button[aria-pressed="true"] { color: var(--teal); background: #e1f2ef; border-color: #badad5; }
.reactions:empty { display: none; }
.quote, .reply-preview { background: #eaf1f3; padding: 7px 10px; border: none; border-left: 3px solid #71a8a6; border-radius: 3px; margin: 0 0 7px; text-align: left; font-size: 12px; color: #284457; max-width: 100%; }
.quote { display: grid; gap: 2px; }
.quote span, .reply-preview small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.reply-preview span { min-width: 0; }
.tool-form { display: grid; gap: 11px; }
.tool-form>.primary { justify-self: start; }
.tool-form p { color: var(--muted); font-size: 13px; margin: 0; }
select { font: inherit; width: 100%; min-width: 0; border: 1px solid #cbdce0; border-radius: 8px; background: white; color: var(--ink); padding: 9px 10px; }
.tool-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); }
.tool-form legend { font-size: 13px; }
.tool-form .check-label, .tool-list li label { display: flex !important; align-items: center; gap: 10px; }
.tool-form .people-choices { margin: 8px 0 0; max-height: min(31dvh, 270px); overflow: auto; border: 1px solid var(--line); border-radius: 7px; padding: 7px; }
.people-choices .check-label { padding: 6px; cursor: pointer; min-height: 30px; }
.people-choices .check-label:hover, .chat-search-hit:hover { background: var(--wash); }
.people-actions { align-items: center; }
#invite { margin-top: 16px; }
#login-status { margin: 0; color: var(--muted); }
input[type="checkbox"] { width: auto; accent-color: var(--teal); }
.tools-content { flex: 1; min-height: 0; display: grid; grid-auto-rows: max-content; align-content: start; gap: 16px; padding: 23px clamp(14px,2.7vw,36px); overflow: auto; }
.tool-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.tool-card h2, .calendar-head h2 { font-size: 19px; letter-spacing: -.03em; margin: 0 0 13px; }
.tool-card .empty { padding: 10px 0; }
.tool-fields { display: grid; gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tool-list li:last-child { border-bottom: 0; }
.tool-list strong, .tool-list small { display: block; overflow-wrap: anywhere; }
.tool-list small { margin-top: 4px; color: var(--muted); }
.done-task strong { text-decoration: line-through; color: var(--muted); }
.calendar-head { display: flex; align-items: center; justify-content: space-between; }
.calendar-head h2 { margin: 0; }
.calendar-head button { border: none; background: var(--wash); color: var(--teal); border-radius: 6px; padding: 3px 10px; font-weight: 800; }
.calendar-head button { font-size: 23px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 9px; background: white; overflow: clip; }
.cal-label, .cal-day { border: solid var(--line); border-width: 0 1px 1px 0; }
.cal-label { text-align: center; padding: 6px; color: var(--muted); font-size: 13px; background: #edf5f5; }
.cal-day { min-width: 0; min-height: 57px; padding: 4px; }
.calendar-date { display: flex; flex-direction: column; align-items: stretch; text-align: start; background: #fff; color: var(--ink); }
.calendar-date:hover { background: var(--wash); }
.calendar-date:focus-visible { outline-offset: -3px; }
.calendar-date[aria-pressed="true"] { background: #e0f2ee; box-shadow: inset 0 0 0 2px var(--teal); }
.cal-day-number { align-self: flex-start; padding: 3px 6px; font-size: 14px; font-weight: 800; }
.cal-day.current { background: #f1fafa; }
.cal-event { min-width: 0; margin-top: 3px; background: var(--wash); color: var(--teal); border-radius: 4px; padding: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.board-post { border-bottom: 1px solid var(--line); padding: 9px 0; }
.board-post p { white-space: pre-wrap; }
.post-title, .search-result { color: var(--ink); width: 100%; border: none; text-align: left; background: none; display: grid; gap: 4px; padding: 7px 5px; border-radius: 6px; }
.post-title:hover, .search-result:hover { background: var(--wash); }
.post-title small, .search-result small { color: var(--muted); font-weight: 400; }
.action-line { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1050px) {
  .drawer { position: fixed; z-index: 2; right: 0; top: 0; width: min(415px,100%); box-shadow: -8px 0 35px #10283825; }
}
@media (max-width: 710px) {
  .login { grid-template-columns: 1fr; }
  .login-intro { padding: 27px 24px; }
  .login-intro h1 { font-size: 38px; margin: 7px 0; }
  .login-intro h1 br, .login-intro p br { display: none; }
  .login-intro p { font-size: 13px; margin: 4px 0; }
  .login-main { padding: 25px; align-items: start; }
  .workspace { flex-direction: column; height: 100dvh; }
  .sidebar { width: 100%; height: auto; flex: 0 0 auto; padding: 9px 11px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
  .sidebar .brand small, .profile small, .profile .avatar, .rooms p { display: none; }
  .brand .symbol { width: 28px; height: 28px; border-radius: 7px; font-size: 15px; }
  .chat-directory { grid-column: 1 / -1; margin: 0; }
  .chat-directory-list { display: flex; gap: 4px; max-height: none; }
  .chat-directory-list button { width: auto; white-space: nowrap; }
  .sidebar nav { grid-column: 1 / -1; display: flex; margin: 0; gap: 6px; overflow: auto; }
  .nav-group { display: flex; align-items: center; }
  .nav-group + .nav-group { border-top: 0; border-left: 1px solid #ffffff24; margin: 0; padding: 0 0 0 6px; }
  .nav-heading { display: none; }
  .sidebar nav button, .sidebar nav .chat-launch { white-space: nowrap; width: auto; }
  .sidebar nav button, .sidebar nav .chat-launch, .rooms button { min-height: 35px; }
  .rooms { grid-column: 1 / -1; flex-direction: row; gap: 5px; margin: 0; }
  .room-sort { display: none; }
  #rooms { display: flex; flex: 1; gap: 7px; }
  #rooms button { width: auto; white-space: nowrap; }
  .profile { grid-row: 1; grid-column: 2; border: 0; margin: 0; padding: 0; }
  .main { flex: 1; height: auto; min-height: 0; }
  .main header { padding: 12px; }
  .header-actions .search-label { display: none; }
  .main header:has(.search-label) { flex-wrap: wrap; }
  .main header:has(.search-label) .header-actions { width: 100%; flex-wrap: wrap; }
  .main header .header-actions .search-label { display: block; flex: 1 1 120px; }
  .main header p { display: none; }
  .thread { padding: 12px; }
  .composer { margin-bottom: 8px; }
  .approval-card { flex-wrap: wrap; }
  .inbox-row { grid-template-columns: minmax(0,1fr) auto; }
  .inbox-row>.badge { grid-column: 1 / -1; }
}
