:root {
	--ink: #1F2328;
	--muted: #4A505A;
	--line: #D5DAE1;
	--ground: #F7F8FA;
	--accent: #2F5BD3;
	--accent-ink: #1E3F99;
	--danger: #B42318;
	--danger-bg: #FDF2F1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
	margin: 0;
	font-family: 'Noto Sans KR', system-ui, sans-serif;
	color: var(--ink);
	background: var(--ground);
}

a { color: var(--accent); }
a:hover { color: var(--accent-ink); }

.center {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.card {
	width: 100%;
	max-width: 420px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 8px;
	border: 1px solid var(--line);
	background: #fff;
	font: inherit;
	font-size: 15px;
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
}
.btn:hover { color: var(--ink); background: #F1F3F6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-google { border-color: #9AA1AB; font-weight: 500; }
.g-mark {
	width: 22px; height: 22px; border-radius: 11px; border: 2px solid #5F6672;
	display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: #E7EEFC; color: var(--accent-ink); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field label { font-weight: 500; }
.input {
	min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
	font: inherit; font-size: 14px; color: var(--ink); background: #fff; width: 100%;
}
.input.is-error { border: 2px solid #C92A2A; }
.error-text { color: var(--danger); font-size: 12px; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #3A4048; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.check a { margin-left: auto; }
.consents { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #E3E6EA; padding-top: 14px; }

.profile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #E3E6EA; border-radius: 10px; font-size: 13px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; object-fit: cover; flex: none; background: #D9E2F7; }

.page { max-width: 880px; margin: 0 auto; padding: 32px 16px 64px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }

.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.legal { line-height: 1.75; font-size: 15px; }
.legal table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid #E3E6EA; padding: 8px 10px; text-align: left; vertical-align: top; }
.legal blockquote { margin: 0; padding: 10px 14px; background: var(--ground); border-radius: 8px; color: var(--muted); }

/* --- calendar screen --- */
.app { display: flex; height: 100vh; background: #fff; }
.side {
	width: 220px; flex: none; background: var(--ground); border-right: 1px solid #E3E6EA;
	padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto;
}
.side .brand { font-size: 17px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; color: #3A4048; text-decoration: none; font-size: 14px; }
.nav a.is-active { background: #E7EEFC; color: var(--accent-ink); font-weight: 700; }
.side-cap { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: #5F6672; }
.cat-filter { display: flex; flex-direction: column; gap: 2px; }
.cat { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; color: #3A4048; cursor: pointer; }
.cat input { width: 16px; height: 16px; margin: 0; }
.me { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.me .avatar { width: 32px; height: 32px; }
.me form { margin: 0 0 0 auto; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; }

.cal-main { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; }
#calendar { flex: 1; min-height: 0; }

.day-panel { width: 300px; flex: none; border-left: 1px solid #E3E6EA; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.day-head { display: flex; align-items: center; gap: 8px; }
.day-head h2 { margin: 0; font-size: 18px; }
.badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #E7EEFC; color: var(--accent-ink); font-weight: 500; }
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.day-item { display: flex; gap: 10px; padding: 10px; border: 1px solid #E3E6EA; border-radius: 8px; font-size: 13px; }
.day-time { width: 64px; flex: none; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: pre-line; }
.day-item b { display: block; font-size: 14px; }
.day-item small { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.is-done-text { text-decoration: line-through; color: var(--muted); }

.btn:disabled { background: #E3E6EA; border-color: #E3E6EA; color: #5F6672; cursor: not-allowed; }
.btn-new { width: 100%; }
.btn-add-day { width: 100%; border-style: dashed; color: var(--muted); font-size: 14px; }
.btn-danger { color: var(--danger); border-color: #F1B8B4; }
.btn-danger:hover { color: var(--danger); background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 500; }
.btn-danger-solid:hover { background: #8F1B12; color: #fff; }

.cat label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.cat .cat-color {
	width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; flex: none;
}
.cat-color::-webkit-color-swatch-wrapper { padding: 2px; }
.cat-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
.cat-color::-moz-color-swatch { border: 0; border-radius: 4px; }

.day-list li { display: block; }
.day-item { width: 100%; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.day-item:hover { border-color: var(--accent); background: #F5F8FF; }
.day-body { min-width: 0; overflow-wrap: anywhere; }

/* --- dialogs (SB-05/06/07) --- */
.modal {
	padding: 0; border: 0; border-radius: 14px; width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 48px);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25); color: var(--ink);
}
.modal::backdrop { background: rgba(20, 22, 26, .48); }
.modal-sm { width: min(420px, calc(100% - 32px)); }
.modal-box { display: flex; flex-direction: column; max-height: calc(100vh - 48px); margin: 0; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px solid #E3E6EA; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; overflow-wrap: anywhere; }
.detail-head { align-items: flex-start; border-bottom: 0; padding-bottom: 6px; }
.detail-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.detail-head h2 { font-size: 20px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-sm .modal-body h2 { margin: 0; font-size: 17px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid #E3E6EA; }
.modal-foot .error-text { margin-right: auto; }
.spacer { flex: 1; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 16px; color: #3A4048; cursor: pointer; flex: none; }
.icon-btn:hover { background: #F1F3F6; }

fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { font-weight: 500; padding: 0; margin-bottom: 6px; }
.req { color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dt { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6px; }
.dt:has(.time-input[hidden]) { grid-template-columns: minmax(0, 1fr); }
.textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus-visible, .seg label:has(input:focus-visible), .chip:has(input:focus-visible), .switch:has(input:focus-visible) .switch-track {
	outline: 2px solid var(--accent); outline-offset: 2px;
}

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; align-self: flex-start; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 22px; border-radius: 11px; background: #B8BFC9; position: relative; flex: none; transition: background .15s; }
.switch-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 8px; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; font-size: 13px; cursor: pointer; }
.chip input, .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip:has(input:checked) { border: 2px solid var(--accent); padding: 0 11px; background: #F5F8FF; font-weight: 500; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.seg label { position: relative; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--line); }
.seg span { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; font-size: 13px; color: #3A4048; background: #fff; }
.seg input:checked + span { background: #1F2328; color: #fff; }

.tags { display: flex; gap: 6px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); font-weight: 500; line-height: 1.4; }
.tag-high { background: #FDE8E7; color: #9F1F17; border-color: #FDE8E7; }
.info { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; margin: 0; font-size: 14px; color: #3A4048; line-height: 1.5; }
.info dt { text-align: center; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.info [hidden] { display: none; }
.pre { white-space: pre-wrap; }

.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
	background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; max-width: calc(100% - 32px);
}

/* FullCalendar look */
.fc { --fc-border-color: #E3E6EA; --fc-today-bg-color: transparent; --fc-button-bg-color: #fff; --fc-button-border-color: #D5DAE1;
	--fc-button-text-color: #1F2328; --fc-button-hover-bg-color: #F1F3F6; --fc-button-hover-border-color: #D5DAE1;
	--fc-button-active-bg-color: #1F2328; --fc-button-active-border-color: #1F2328; --fc-now-indicator-color: #C92A2A; font-size: 13px; }
.fc .fc-button { font-size: 13px; box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-size: 20px; font-weight: 700; }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: #3A4048; text-decoration: none; }
.fc .fc-day-sun .fc-col-header-cell-cushion, .fc .fc-day-sun .fc-daygrid-day-number { color: #C92A2A; }
.fc .fc-day-sat .fc-col-header-cell-cushion, .fc .fc-day-sat .fc-daygrid-day-number { color: #2F5BD3; }
.fc .fc-day-other { background: #FAFBFC; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--accent); color: #fff; border-radius: 12px; min-width: 24px; text-align: center; margin: 2px; }
.fc .fc-daygrid-day.is-selected { box-shadow: inset 0 0 0 2px var(--accent); background: #F5F8FF; }
.fc .fc-event { border-width: 0 0 0 0; border-radius: 4px; padding: 1px 4px; cursor: pointer; }
.fc .fc-timegrid-event { border-left: 3px solid; }
.fc .fc-event.is-done .fc-event-title { text-decoration: line-through; }
.fc .fc-event.is-canceled { opacity: .5; }
.fc .fc-event.is-high .fc-event-title { font-weight: 700; }
.fc .fc-daygrid-more-link { color: #3A4048; font-weight: 500; }

@media (max-width: 1100px) {
	.day-panel { display: none; }
}
@media (max-width: 767px) {
	.app { flex-direction: column; height: auto; min-height: 100vh; }
	.side { width: auto; border-right: 0; border-bottom: 1px solid #E3E6EA; gap: 12px; }
	.cat-filter { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
	.cal-main { padding: 8px; }
	#calendar { min-height: 600px; }
	.fc .fc-toolbar { flex-wrap: wrap; gap: 8px; }
	.day-panel { display: flex; width: auto; border-left: 0; border-top: 1px solid #E3E6EA; }
	.btn-new { width: auto; align-self: flex-start; }
	.modal, .modal-box { max-height: calc(100vh - 16px); }
	.modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
	.field-row { grid-template-columns: minmax(0, 1fr); }
	.seg span { padding: 0 12px; }
}

.label-like { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.field > .btn { align-self: flex-start; }

/* --- todos (SB-05/06) --- */
.todo-sec { display: flex; flex-direction: column; gap: 8px; }
.todo-cap { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #5F6672; }
.todo-cap .count { font-weight: 500; white-space: nowrap; }
.bar { height: 8px; border-radius: 4px; background: #E3E6EA; overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; width: 0; background: #2F8A3E; transition: width .2s; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo { display: flex; align-items: center; gap: 8px; min-height: 42px; border: 1px solid #E3E6EA; border-radius: 8px; padding: 4px 6px 4px 4px; font-size: 14px; background: #fff; }
.todo.is-dragging { opacity: .5; }
.todo.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.todo.drop-after { box-shadow: 0 2px 0 var(--accent); }
.todo input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; }
.todo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo.is-done .todo-text { text-decoration: line-through; color: #5F6672; }
.grip { width: 28px; height: 32px; border: 0; background: none; color: #6B7280; cursor: grab; border-radius: 6px; flex: none; font-size: 14px; letter-spacing: -2px; }
.grip:focus-visible { outline: 2px solid var(--accent); }
.todo .icon-btn { width: 30px; height: 30px; font-size: 13px; }
.todo-add { display: flex; gap: 6px; }
.todo-add .input { min-height: 40px; }
.todo-add .btn { min-height: 40px; flex: none; }

/* --- search (SB-09) --- */
.search-main { flex: 1; min-width: 0; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.search-main h1 { margin: 0; font-size: 22px; }
.search-form { display: flex; flex-direction: column; gap: 14px; }
.search-bar { display: flex; gap: 8px; }
.search-bar .input { min-height: 48px; font-size: 15px; }
.search-bar .btn { min-height: 48px; padding: 0 24px; flex: none; }
.search-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; padding: 16px; background: var(--ground); border-radius: 10px; }
.search-filters .field { min-width: 0; }
.search-filters select.input { min-width: 120px; }
.search-filters > .btn { min-height: 44px; }
.range { display: flex; align-items: center; gap: 6px; }
.range .input { width: 160px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chips label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; font-size: 13px; font-weight: 400; cursor: pointer; }
.cat-chips label:has(input:checked) { border: 2px solid var(--accent); background: #F5F8FF; color: var(--accent-ink); font-weight: 700; }
.cat-chips label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.results-head h2 { margin: 0; font-size: 16px; }
.results-head select.input { width: auto; margin-left: auto; min-height: 38px; }
.search-results { display: flex; flex-direction: column; gap: 12px; }
.search-results[aria-busy="true"] .result-list { opacity: .6; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid #E3E6EA; }
.result { width: 100%; display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 8px; border: 0; border-bottom: 1px solid #E3E6EA; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.result:hover { background: #F7F8FA; }
.result:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.result-when { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: #4A505A; }
.result-when b { color: var(--ink); font-weight: 500; }
.result-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.result-title { font-size: 15px; overflow-wrap: anywhere; }
.result-snippet { font-size: 12px; color: #4A505A; overflow-wrap: anywhere; }
.result-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #3A4048; white-space: nowrap; }
.result mark { background: #FFF1A8; color: inherit; padding: 0 1px; border-radius: 2px; }
.status-tag { padding: 2px 6px; border-radius: 4px; background: #EEF0F2; color: #3F444C; font-weight: 500; }
.status-tag.status-in_progress { background: #E7EEFC; color: var(--accent-ink); }
.status-tag.status-done { background: #E6F4E8; color: #1F6129; }
.status-tag.status-canceled { background: #F1F2F4; color: #5F6672; text-decoration: line-through; }
.is-high-text { color: #B42318; font-weight: 700; }
.empty-state { padding: 32px 16px; text-align: center; color: #3A4048; }
.empty-state p { margin: 0 0 4px; }
.pager { display: flex; justify-content: center; gap: 4px; }
.pager[hidden] { display: none; }
.pager-btn { min-width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.pager-btn.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager-btn:disabled { color: #A0A6AF; cursor: default; }

@media (max-width: 767px) {
	.search-main { padding: 16px; }
	.search-filters { flex-direction: column; align-items: stretch; }
	.range .input { width: auto; flex: 1; min-width: 0; }
	.result { grid-template-columns: minmax(0, 1fr); gap: 6px; }
	.result-meta { white-space: normal; flex-wrap: wrap; }
}

/* --- account (SB-10) --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.account-main { flex: 1; min-width: 0; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.account-main h1 { margin: 0; font-size: 22px; }
.account-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; max-width: 1080px; }
.account-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.account-card { display: flex; flex-direction: column; gap: 14px; }
.account-card h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-card h2 .tag { margin-left: auto; font-weight: 400; color: var(--muted); }
.account-form { display: flex; flex-direction: column; gap: 14px; }
.account-form > .btn, .account-end { align-self: flex-end; }
.account-note { font-size: 13px; }
.account-row { flex-direction: row; align-items: center; justify-content: space-between; }
.account-row form { margin: 0; }
.cat-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid #EEF0F3; font-size: 14px; }
.cat-row:last-child { border-bottom: 0; }
.cat-row .cat-color { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; flex: none; }
.cat-row .switch { margin-left: auto; align-self: center; }
.danger-card h2 { color: #9F1F17; }
.danger-card form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.danger-card .alert { margin: 0; }
.warn { margin: 0; padding: 12px 12px 12px 30px; background: var(--danger-bg); border-radius: 8px; color: #6E1A14; font-size: 13px; line-height: 1.7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 1100px) {
	.account-cols { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
}
@media (max-width: 767px) {
	.account-main { padding: 16px; }
}
