.ct-rte { box-sizing: border-box; width: 100%; border: 1px solid #4b0012; border-radius: 5px; background: #fff; overflow: hidden; }
#format-buttons { display: none; }
.ct-rte-toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 7px; background: #4b0012; background: linear-gradient(to bottom, #6b142a 0%, #4b0012 58%, #39000d 100%); border-bottom: 1px solid #2c000a; }
.ct-rte-toolbar button { min-width: 32px; min-height: 30px; padding: 4px 9px; border: 1px solid #31000c; border-radius: 4px; background: #fff; color: #3b0010; box-shadow: 0 1px 1px rgba(0,0,0,.28); cursor: pointer; }
.ct-rte-toolbar button:hover, .ct-rte-toolbar button.active { background: #f3e4e8; border-color: #4b0012; }
.ct-rte-format-menu { position: absolute; z-index: 21; top: calc(100% - 2px); left: 4px; display: none; width: 145px; padding: 5px; border: 1px solid #8b3d50; border-radius: 0 0 5px 5px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.ct-rte-format-menu.open { display: grid; gap: 4px; }
.ct-rte-toolbar .ct-rte-format-menu button { display: block; width: 100%; min-height: 34px; text-align: left; box-shadow: none; }
.ct-rte-align-menu { position: absolute; z-index: 21; top: calc(100% - 2px); left: 145px; display: none; width: 145px; padding: 5px; border: 1px solid #8b3d50; border-radius: 0 0 5px 5px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.ct-rte-align-menu.open { display: grid; gap: 4px; }
.ct-rte-toolbar .ct-rte-align-menu button { display: block; width: 100%; min-height: 34px; text-align: left; box-shadow: none; }
.ct-rte-color-menu { position: absolute; z-index: 22; top: calc(100% - 2px); left: 74px; display: none; grid-template-columns: repeat(6, 30px); gap: 5px; width: 205px; padding: 7px; border: 1px solid #8b3d50; border-radius: 0 0 5px 5px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.ct-rte-color-menu.open { display: grid; }
.ct-rte-toolbar .ct-rte-color-menu button { box-sizing: border-box; min-width: 30px; width: 30px; min-height: 30px; height: 30px; padding: 3px; box-shadow: none; }
.ct-rte-color-menu button span { display: block; width: 100%; height: 100%; border: 1px solid rgba(0,0,0,.35); box-sizing: border-box; }
.ct-rte-footer { box-sizing: border-box; display: flex; justify-content: flex-end; padding: 5px 7px; border-top: 1px solid #ddd; background: #f3f3f3; }
.ct-rte-footer .ct-rte-source-toggle { min-height: 28px; padding: 3px 9px; border: 1px solid #aaa; border-radius: 4px; color: #3b0010; background: #fff; cursor: pointer; }
.ct-rte-footer .ct-rte-source-toggle.active { color: #fff; border-color: #4b0012; background: #4b0012; }
.ct-rte-smiley-menu { position: absolute; z-index: 20; top: calc(100% - 2px); left: 150px; display: none; grid-template-columns: repeat(8, minmax(34px, 1fr)); gap: 3px; width: min(330px, calc(100% - 20px)); max-height: 190px; padding: 7px; overflow-y: auto; border: 1px solid #8b3d50; border-radius: 0 0 5px 5px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.ct-rte-smiley-menu.open { display: grid; }
.ct-rte-toolbar .ct-rte-smiley-menu button { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 2px; border-color: #ddd; box-shadow: none; }
.ct-rte-smiley-menu img { width: auto; height: auto; max-width: 28px; max-height: 28px; }
.ct-rte-surface { box-sizing: border-box; min-height: 260px; padding: 10px; overflow: auto; color: #222; background: #fff; font: 14px/1.45 Verdana, Helvetica, Arial, sans-serif; outline: 0; white-space: normal; }
.ct-rte-surface a { max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; word-break: break-all; }
.ct-rte-surface ul { margin: 7px 0 7px 24px; padding-left: 18px; list-style: disc outside !important; }
.ct-rte-surface ol { margin: 7px 0 7px 24px; padding-left: 18px; list-style: decimal outside !important; }
.ct-rte-surface li { display: list-item !important; margin: 3px 0; padding: 0; list-style: inherit !important; }
.ct-rte-source { box-sizing: border-box; display: none; width: 100% !important; min-height: 260px; margin: 0 !important; border: 0 !important; border-radius: 0; }
.ct-rte-media { position: relative; display: inline-block; max-width: 94%; margin: 5px 4px; padding: 3px; border: 1px solid #b9c2ca; border-radius: 4px; background: #f4f6f8; vertical-align: middle; user-select: all; }
.ct-rte-media img { display: block; width: auto; height: auto; max-width: 240px; max-height: 170px; object-fit: contain; }
.ct-rte-youtube-label { position: absolute; left: 50%; top: 50%; padding: 5px 9px; border-radius: 4px; color: #fff; background: rgba(190, 0, 0, .88); transform: translate(-50%, -50%); white-space: nowrap; }
.ct-rte-remove { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #a00; font: bold 17px/21px Arial; cursor: pointer; }
.ct-rte-smiley { display: inline-block; width: auto; height: auto; max-width: 48px; max-height: 48px; margin: 0 2px; vertical-align: middle; }
.ct-rte blockquote { margin: 7px 12px; padding: 7px 10px; border-left: 4px solid #9aa7b3; background: #f2f3f4; }
.ct-rte pre { padding: 8px; overflow: auto; background: #eee; font-family: monospace; white-space: pre-wrap; }

/* Los accesos a smilies y fotos ahora viven dentro del encabezado del editor. */
#smiley-box { display: none; }
#message-box { box-sizing: border-box; width: 100%; }
.ct-post-actions button[name="fotos"] { display: none; }

/* El tema oscuro no debe filtrarse al historial mostrado debajo del editor. */
#review { box-sizing: border-box; margin: 12px 0 0; padding: 8px 10px; border: 1px solid #d1b7bd; border-bottom: 0; border-radius: 5px 5px 0 0; color: #3b1821; background: #f4e8eb; text-shadow: none; }
#topicreview { box-sizing: border-box; padding: 7px; border: 1px solid #d1b7bd; border-radius: 0 0 5px 5px; background: #f5f5f5; }
#topicreview .post, #topicreview .post.bg1, #topicreview .post.bg2, #topicreview .post.bg3 { margin: 0 0 6px; padding: 0; border: 1px solid #d2d2d2 !important; border-radius: 5px; background: #fff !important; box-shadow: none; }
#topicreview .post > .inner { display: block; padding: 10px 14px; background: #fff; }
#topicreview .postbody { box-sizing: border-box; width: 100%; padding: 0; border: 0; background: #fff; box-shadow: none; }
#topicreview .postbody h3 { margin: 0 0 5px !important; padding: 0 0 5px; color: #111; background: transparent; }
#topicreview .content { color: #111; background: #fff; }
.ct-posting-spoilers { box-sizing: border-box; margin: 8px 0 10px; padding: 8px 10px; border: 1px solid #d5d5d5; border-radius: 5px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.ct-guest-quickreply { margin: 12px 0; }
.ct-guest-quickreply-panel { padding: 10px; border: 1px solid #d5d5d5; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.ct-guest-quickreply-panel h3 { margin: 0 0 4px; color: #4b0012; font-size: 15px; }
.ct-guest-quickreply-hint { margin: 0 0 9px; color: #555; }
.ct-guest-quickreply #message-box { width: 100%; }
.ct-guest-quickreply .ct-rte-surface { min-height: 130px; }
body.ct-guest-modal-open { overflow: hidden; }
.ct-guest-register-modal { position: fixed; z-index: 100000; inset: 0; display: none; align-items: center; justify-content: center; box-sizing: border-box; padding: 18px; }
.ct-guest-register-modal.open { display: flex; }
.ct-guest-register-backdrop { position: absolute; inset: 0; background: rgba(10,0,3,.72); backdrop-filter: blur(2px); }
.ct-guest-register-card { position: relative; z-index: 1; box-sizing: border-box; width: 100%; max-width: 480px; padding: 28px 30px 26px; border: 1px solid #7d2036; border-radius: 12px; color: #262626; background: #fff; box-shadow: 0 18px 55px rgba(0,0,0,.45); text-align: center; }
.ct-guest-register-close { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; padding: 0; border: 0; color: #777; background: transparent; font: 28px/30px Arial; cursor: pointer; }
.ct-guest-register-close:hover { color: #4b0012; }
.ct-guest-register-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: linear-gradient(to bottom, #72162d, #4b0012); box-shadow: 0 5px 14px rgba(75,0,18,.28); font-size: 28px; }
.ct-guest-register-card h2 { margin: 0 0 9px; color: #3b000e; font-size: 23px; text-shadow: none; }
.ct-guest-register-card > p { margin: 0 auto 17px; max-width: 390px; color: #555; font-size: 14px; line-height: 1.45; }
.ct-guest-register-card ul { display: inline-block; margin: 0 auto 20px; padding: 0; color: #333; list-style: none; text-align: left; }
.ct-guest-register-card li { margin: 7px 0; }
.ct-guest-register-card li .fa { width: 20px; color: #2f7c45; }
.ct-guest-register-actions { display: flex; justify-content: center; gap: 9px; }
.ct-guest-register-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 18px; border-radius: 5px; font-weight: bold; text-decoration: none !important; }
.ct-guest-register-primary { border: 1px solid #38000d; color: #fff !important; background: linear-gradient(to bottom, #72162d, #4b0012); }
.ct-guest-register-primary:hover { color: #fff !important; background: #38000d; }
.ct-guest-register-secondary { border: 1px solid #bbb; color: #333 !important; background: linear-gradient(to bottom, #fff, #e8e8e8); }
.ct-guest-register-secondary:hover { color: #4b0012 !important; border-color: #8f6b74; background: #f4ecee; }
@media (max-width: 700px) {
	.ct-rte, .ct-rte-toolbar, .ct-rte-surface, .ct-rte-source { min-width: 0; max-width: 100%; }
	.ct-rte-toolbar { position: sticky; top: 0; z-index: 2; padding: 4px; }
	.ct-rte-toolbar button { min-height: 36px; font-size: 13px; }
	.ct-rte-smiley-menu { left: 4px; grid-template-columns: repeat(6, minmax(36px, 1fr)); width: calc(100% - 22px); }
	.ct-rte-surface, .ct-rte-source { min-height: 220px; overflow-wrap: anywhere; word-break: break-word; font-size: 16px; }
	.ct-rte-media { max-width: 125px; margin: 4px 2px; }
	.ct-rte-media img { max-width: 115px; max-height: 90px; }
	.ct-rte-youtube-label { padding: 3px 5px; font-size: 11px; }
	#message-box { width: 100%; }
	.ct-guest-register-card { padding: 24px 18px 20px; }
	.ct-guest-register-card h2 { font-size: 20px; }
	.ct-guest-register-actions { flex-direction: column; }
	.ct-guest-register-actions a { width: 100%; box-sizing: border-box; }
}
