/* [추가] 전체 페이지 및 내부 요소 커스텀 스크롤바 디자인 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #090a0f; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; border: 2px solid #090a0f; }
::-webkit-scrollbar-thumb:hover { background: #00f2ff; box-shadow: 0 0 10px rgba(0, 242, 255, 0.5); }

textarea::-webkit-scrollbar { width: 6px; }
textarea::-webkit-scrollbar-thumb { background: rgba(0, 242, 255, 0.2); }
textarea::-webkit-scrollbar-thumb:hover { background: #00f2ff; }

* { scrollbar-width: thin; scrollbar-color: #1e293b #090a0f; }

#WRITE_WRAP {
	position: relative;
	min-height: 100vh;
	background: #020616;
	padding: 60px 0;
	font-family: 'Pretendard', sans-serif;
}

#WRITE {
	position: relative;
	z-index: 2;
	width: 90%;
	margin: 0 auto;
}

.write-top-bar {
	padding: 30px 40px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.write-top-title {
	margin: 0;
	font-size: 1.8rem;
	color: #00f2ff;
	letter-spacing: 1px;
	font-weight: 800;
}

.write-top-actions {
	display: flex;
	gap: 15px;
}

#fwrite {
	background: rgba(14, 22, 40, 0.92);
	backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 7px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.write-table { width: 100%; border-collapse: collapse; }
.write-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.05); transition: 0.3s; }
.td-label {
	width: 200px;
	padding: 25px 30px;
	color: #e2e8f0;
	font-size: 0.9rem;
	font-weight: 700;
	background: rgba(255, 255, 255, 0.02);
}
.td-label i { width: 28px; color: #00f2ff; margin-right: 12px; }

.td-value {
	padding: 20px 40px;
}

.field-row-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.field-caption {
	color: #64748b;
	font-size: 0.9rem;
	margin-left: 5px;
}

.field-caption.no-margin {
	margin-left: 0;
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
	background: rgba(0, 0, 0, 0.4) !important;
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	color: #fff !important;
	padding: 12px 18px !important;
	border-radius: 5px !important;
	font-size: 0.8rem;
	transition: all 0.3s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

select {
	padding-right: 40px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300f2ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: calc(100% - 12px) center !important;
	background-size: 16px !important;
	cursor: pointer;
}
select option { background-color: #0f172a !important; color: #fff !important; }

.switch { position: relative; display: inline-block; width: 45px; height: 22px; vertical-align: middle; margin: 0 5px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #1e293b;
	transition: 0.4s;
	border-radius: 17px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.slider:before {
	position: absolute;
	content: "";
	height: 14px;
	width: 14px;
	left: 4px;
	bottom: 3px;
	background-color: #64748b;
	transition: 0.4s;
	border-radius: 50%;
}
.switch input:checked + .slider { background-color: rgba(0, 242, 255, 0.2); border-color: #00f2ff; }
.switch input:checked + .slider:before { transform: translateX(21px); background-color: #00f2ff; box-shadow: 0 0 8px #00f2ff; }

textarea { line-height: 27px; padding: 25px; width: 100%; box-sizing: border-box; overflow-y: auto; }

input[type="text"]:hover,
select:hover,
input[type="date"]:hover,
input[type="time"]:hover {
	border-color: rgba(0, 242, 255, 0.5) !important;
	background: rgba(255, 255, 255, 0.05) !important;
	box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

input[type="text"]:focus,
select:focus {
	border-color: #00f2ff !important;
	box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
	outline: none;
}

input[type="date"],
input[type="time"] {
	position: relative;
	background: rgba(0, 0, 0, 0.4) !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	color: #fff !important;
	padding: 10px 15px !important;
	border-radius: 5px !important;
	color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; opacity: 0.8; }

.file-row {
	display: none;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 7px;
}
.file-row.active { display: flex; flex-wrap: wrap; }

.btn-add-file {
	background: none;
	border: 1px solid #334155;
	color: #8fa3ad;
	padding: 8px 20px;
	border-radius: 7px;
	cursor: pointer;
}

.btn-memo-toggle {
	background: #0062ff;
	border: 1px solid #003fa5;
	color: #fff;
	padding: 8px 25px;
	border-radius: 4px;
	font-size: 0.8rem;
}

.note-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(2, 6, 22, 0.72);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 20;
}

.note-drawer-backdrop.open {
	opacity: 1;
	pointer-events: auto;
}

.note-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: min(420px, 92vw);
	height: 100vh;
	padding: 24px;
	background: #020616;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	z-index: 30;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.note-drawer.open {
	transform: translateX(0);
}

.note-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.note-drawer-head h3 {
	margin: 0;
	font-size: 1rem;
	color: #e2e8f0;
}

.btn-note-close {
	width: 36px;
	height: 36px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	color: #e2e8f0;
}

.note-drawer-body {
	flex: 1;
	display: flex;
}

.note-drawer-body textarea {
	min-height: 100%;
	resize: none;
}

.routine-popup {
	position: fixed;
	inset: 0;
	display: none;
	z-index: 40;
}

.routine-popup.open {
	display: block;
}

.routine-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 22, 0.78);
}

.routine-popup-dialog {
	position: relative;
	width: min(1100px, calc(100vw - 48px));
	height: min(80vh, 900px);
	margin: 6vh auto 0;
	background: #020616;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 1;
}

.routine-popup-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
}

.routine-popup-head h3 {
	margin: 0;
	font-size: 1rem;
	color: #e2e8f0;
}

.routine-popup-body {
	flex: 1;
	background: #020616;
}

.routine-popup-body iframe {
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.memo-area {
	display: none;
	margin-top: 18px;
	padding: 20px;
	width: 100%;
	background: rgba(255,255,255,0.02);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 7px;
}

.memo-area.open {
	display: block;
}

.memo-clean-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.btn-note {
	background: #0062ff;
	border: 1px solid #003fa5;
	color: #fff;
	padding: 8px 25px;
	border-radius: 7px;
	font-size: 0.8rem;
}

.date-time-wrap {
	margin-left: auto;
	display: flex;
	gap: 10px;
	align-items: center;
}

.editor-toggle-row {
	text-align: center;
	padding: 15px;
	background: rgba(255,255,255,0.01);
}

.btn-editor-toggle {
	background: none;
	border: 1px dashed #00f2ff;
	color: #00f2ff;
	padding: 8px 30px;
	border-radius: 7px;
	cursor: pointer;
}

.section-title {
	color: #e2e8f0;
	font-size: 0.9rem;
	margin-bottom: 15px;
}

.section-title i {
	color: #00f2ff;
	margin-right: 10px;
}

.work-line-section {
	border-top: 1px solid rgba(255,255,255,0.05);
}

.work-line-row {
	padding: 14px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 7px;
	margin-bottom: 12px;
}

.work-line-time-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.work-line-time {
	width: 220px;
	font-size: 0.78rem;
	padding: 8px 12px !important;
}

.work-line-content {
	width: 100%;
	min-height: 95px;
	padding: 12px !important;
	line-height: 1.6;
}

.btn-add-line {
	background: none;
	border: 1px solid #334155;
	color: #8fa3ad;
	padding: 8px 20px;
	border-radius: 7px;
	cursor: pointer;
}

.write-submit-wrap {
	padding: 60px;
	text-align: center;
	border-top: 1px solid rgba(255,255,255,0.05);
}
.file-btn-custom {
	background: #00f2ff;
	color: #000;
	padding: 7px 15px;
	border-radius: 5px;
	font-weight: 700;
	cursor: pointer;
	font-size: 0.8rem;
	transition: 0.3s;
}
.file-btn-custom:hover { background: #fff; transform: scale(1.05); }
.file-desc-input {
	background: rgba(255, 255, 255, 0.05) !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	width: 300px !important;
	font-size: 0.8rem !important;
	height: 35px !important;
}

.btn-action { transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; }
.btn-action:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.1); box-shadow: 0 10px 25px rgba(0, 242, 255, 0.4); }
.btn-save-main {
	background: linear-gradient(45deg, #00f2ff, #0062ff);
	color: #fff;
	padding: 18px 100px;
	border-radius: 7px;
	font-weight: 800;
	border: none;
}
.btn-save-top { background: #00f2ff; color: #000; border: none; padding: 10px 25px; border-radius: 5px; font-weight: 700; }
.btn-cancel-top { background: #1e293b; color: #fff; border: none; padding: 10px 25px; border-radius: 5px; }

.extra-code-section { padding: 30px; background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.05); }
.link-item { display: flex; align-items: center; gap: 10px; }
.link-item i { color: #00f2ff; width: 20px; }

.option-toggle-wrap {
	gap: 10px;
}

.option-toggle-switch {
	position: relative;
	height: 34px;
	padding: 0 12px;
	border-radius: 7px;
	border: 1px solid rgba(255,255,255,0.18);
	background: rgba(0, 0, 0, 0.35);
	color: #cbd5e1;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.78rem;
	user-select: none;
}

.option-toggle-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.option-toggle-track {
	position: relative;
	width: 40px;
	height: 20px;
	border-radius: 999px;
	background: #1e293b;
	border: 1px solid rgba(255,255,255,0.18);
	transition: all 0.3s ease;
	flex: 0 0 auto;
}

.option-toggle-track::before {
	content: '';
	position: absolute;
	left: 3px;
	top: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #64748b;
	transform: translateY(-50%);
	transition: all 0.3s ease;
}

.option-toggle-switch .toggle-left {
	font-weight: 700;
	color: #e2e8f0;
}

.option-toggle-switch .toggle-right {
	font-size: 0.72rem;
	color: #8fa3ad;
	margin-left: 10px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 220px;
}

.option-toggle-switch .toggle-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.option-toggle-switch .toggle-status i {
	color: #64748b;
	transition: color 0.3s ease;
}

.option-toggle-switch .toggle-status.has-value i {
	color: #00f2ff;
}

.option-toggle-switch .toggle-status .status-text {
	color: #8fa3ad;
}

.option-toggle-switch .toggle-status.has-value .status-text {
	color: #00f2ff;
}

.option-toggle-switch.is-on {
	border-color: #00f2ff;
	background: rgba(0, 242, 255, 0.12);
}

.option-toggle-switch.is-on .option-toggle-track {
	background: rgba(0, 242, 255, 0.2);
	border-color: #00f2ff;
}

.option-toggle-switch.is-on .option-toggle-track::before {
	left: calc(100% - 17px);
	background: #00f2ff;
	box-shadow: 0 0 8px #00f2ff;
}

.option-toggle-switch.is-on .toggle-right {
	color: #00f2ff;
}

.option-toggle-switch .toggle-icon {
	max-width: none;
	font-size: 0.86rem;
	line-height: 1;
}

.option-toggle-switch .toggle-icon i {
	color: #64748b;
	transition: color 0.3s ease;
}

.option-toggle-switch .toggle-icon.has-value i {
	color: #00f2ff;
}

.option-panel {
	display: none;
	padding: 14px;
	margin-bottom: 12px;
	background: rgba(255,255,255,0.02);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 7px;
	margin-top:20px;
}

.option-panel.open {
	display: block;
}

.option-panel-title {
	color: #e2e8f0;
	font-size: 0.82rem;
	font-weight: 700;
	margin-bottom: 10px;
	padding-left: 20px;
}

.option-way-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.option-way-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 7px;
	background: rgba(255,255,255,0.02);
}

.weather-radio-grid {
	gap: 10px;
}

.weather-radio-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 5px;
	background: rgba(255,255,255,0.03);
	color: #e2e8f0;
	cursor: pointer;
}

.weather-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.weather-radio-label i {
	color: #7dd3fc;
	width: 16px;
	text-align: center;
}

.weather-radio-item input[type="radio"] {
	accent-color: #00f2ff;
}

@media (max-width: 900px) {
	.note-drawer {
		width: 100%;
	}

	.routine-popup-dialog {
		width: calc(100vw - 24px);
		height: 88vh;
		margin-top: 3vh;
	}
}

.option-week-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 10px;
}

.option-week-item {
	min-width: 0;
}

.option-week-item textarea {
	min-height: 140px;
	padding: 10px !important;
	line-height: 1.5;
}

.option-week-label {
	color: #8fa3ad;
	font-size: 0.75rem;
	margin-bottom: 6px;
	text-align: center;
}
