/* Rautavaara Matkaopas widget. All colours come from CSS variables set by the
   admin settings, so the plugin never inherits (and never gets washed out by)
   the surrounding theme. */
.rm-floating, .rm-inline {
	--rm-accent: #2e7d32;
	--rm-launcher-bg: #2e7d32;
	--rm-launcher-text: #ffffff;
	--rm-header-bg: #2e7d32;
	--rm-header-text: #ffffff;
	--rm-user-bg: #2e7d32;
	--rm-user-text: #ffffff;
	--rm-bot-bg: #ffffff;
	--rm-bot-text: #1d2327;
	--rm-panel-bg: #f6f7f7;
	--rm-panel-width: 380px;
}

.rm-floating { position: fixed; z-index: 99999; }
.rm-floating.rm-bottom { bottom: 22px; }
.rm-floating.rm-top    { top: 22px; }
.rm-floating.rm-right   { right: 22px; }
.rm-floating.rm-left    { left: 22px; }
.rm-floating.rm-hcenter { left: 50%; transform: translateX(-50%); }

.rm-launcher {
	display: inline-flex; align-items: center; gap: 8px;
	border: none; cursor: pointer;
	color: var(--rm-launcher-text);
	background: var(--rm-launcher-bg);
	border-radius: 999px; padding: 12px 18px;
	font: 600 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 6px 22px rgba(0,0,0,.22);
	transition: transform .15s ease, box-shadow .15s ease;
}
.rm-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.rm-launcher .rm-launcher-icon { font-size: 20px; line-height: 1; }

/* Panel */
.rm-panel {
	display: none; flex-direction: column; overflow: hidden;
	width: var(--rm-panel-width, 380px); max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 120px);
	background: var(--rm-panel-bg); border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0,0,0,.28);
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--rm-bot-text);
}
.rm-floating .rm-panel { position: absolute; }
.rm-floating.rm-bottom .rm-panel { bottom: 66px; }
.rm-floating.rm-top    .rm-panel { top: 66px; }
.rm-floating.rm-right  .rm-panel { right: 0; }
.rm-floating.rm-left   .rm-panel { left: 0; }
.rm-floating.rm-hcenter .rm-panel { left: 50%; transform: translateX(-50%); }
.rm-panel.rm-open { display: flex; }

.rm-inline { display: block; }
.rm-inline .rm-panel { display: flex; width: 100%; height: 100%; max-height: none; box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.rm-inline .rm-launcher { display: none; }

.rm-header {
	background: var(--rm-header-bg); color: var(--rm-header-text);
	padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.rm-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--rm-header-text); }
.rm-header-actions { display: flex; gap: 6px; }
.rm-iconbtn {
	background: rgba(255,255,255,.18); border: none; color: var(--rm-header-text); cursor: pointer;
	width: 28px; height: 28px; border-radius: 8px; font-size: 15px; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center;
}
.rm-iconbtn:hover { background: rgba(255,255,255,.32); }

.rm-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--rm-panel-bg); position: relative; scroll-behavior: smooth; }

.rm-msg { margin-bottom: 12px; display: flex; }
.rm-msg .rm-bubble {
	max-width: 84%; padding: 10px 13px; border-radius: 14px;
	white-space: pre-wrap; word-wrap: break-word;
}
.rm-msg.rm-bot .rm-bubble {
	background: var(--rm-bot-bg); color: var(--rm-bot-text);
	border: 1px solid rgba(0,0,0,.08); border-bottom-left-radius: 4px;
}
.rm-msg.rm-user { justify-content: flex-end; }
.rm-msg.rm-user .rm-bubble {
	background: var(--rm-user-bg); color: var(--rm-user-text);
	border-bottom-right-radius: 4px;
}
.rm-typing .rm-bubble { opacity: .7; font-style: italic; }

/* Language chooser */
.rm-langs { padding: 4px 0; }
.rm-langs-label { color: var(--rm-bot-text); opacity: .8; margin-bottom: 10px; }
.rm-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-flag {
	display: inline-flex; align-items: center; gap: 8px;
	background: #ffffff; color: #1d2327; border: 1px solid #dcdcde; border-radius: 10px;
	padding: 7px 12px 7px 8px; cursor: pointer; font-size: 14px; line-height: 1.2;
}
.rm-flag:hover { border-color: var(--rm-accent); box-shadow: 0 0 0 2px rgba(0,0,0,.06); }
.rm-flag-img { display: inline-flex; }
.rm-flag-img svg {
	width: 28px; height: 19px; display: block;
	border-radius: 3px; border: 1px solid rgba(0,0,0,.15);
}
.rm-flag-code {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 19px; font-size: 11px; font-weight: 700;
	background: #eee; border-radius: 3px; color: #333;
}
.rm-flag-label { color: #1d2327; }

/* Footer / input */
.rm-footer { border-top: 1px solid rgba(0,0,0,.08); padding: 10px; display: flex; gap: 8px; background: var(--rm-bot-bg); }
.rm-input {
	flex: 1; resize: none; border: 1px solid #dcdcde; border-radius: 10px;
	padding: 10px 12px; font: inherit; color: #1d2327; background: #fff;
	max-height: 120px; min-height: 42px;
}
.rm-input:focus { outline: none; border-color: var(--rm-accent); }
.rm-send {
	border: none; cursor: pointer; color: #fff; background: var(--rm-accent);
	border-radius: 10px; padding: 0 16px; font-weight: 600;
}
.rm-send:disabled { opacity: .5; cursor: default; }

.rm-powered { text-align: center; font-size: 11px; color: #8c8f94; padding: 6px 0 10px; background: var(--rm-bot-bg); }

/* GDPR consent gate */
.rm-consent { padding: 2px; color: var(--rm-bot-text); }
.rm-consent-text { font-size: 13.5px; line-height: 1.55; }
.rm-consent-text p { margin: 0 0 10px; }
.rm-consent-text a, .rm-consent-link a { color: var(--rm-accent); }
.rm-consent-link { margin: 2px 0 12px; font-size: 13.5px; }
.rm-consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 14px; cursor: pointer; font-size: 14px; }
.rm-consent-cb { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.rm-consent-btn {
	border: none; cursor: pointer; color: #fff; background: var(--rm-accent);
	border-radius: 10px; padding: 10px 18px; font-weight: 600; font-size: 15px;
}
.rm-consent-btn:disabled { opacity: .5; cursor: default; }
