/*
 * ROTS skin for Roundcube 1.7 (child of elastic). Hand-written layer, loaded after rots-palette.css.
 * Look: the game's PC menus (RiseOfTheReds/ui/mobile/tokens.rcss, body.desktop): steel panels with hairlines and
 * square corners, ROTS red for the brand and the call to action (iOS RTSButtonStylePrimary gradient), amber for
 * selection and focus. Dark only: templates/includes/layout.html always sets html.dark-mode.
 * Fonts: Inter (SIL Open Font License, fonts/Inter-OFL.txt).
 */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/inter-800.woff2") format("woff2"); }

:root {
	--rots-bg: #0e1216;          /* window background (--pc-bg) */
	--rots-panel-from: #1a2027;  /* panel gradient top */
	--rots-panel: #141a20;       /* panel / flat fill */
	--rots-raised: #222a33;      /* raised controls, hovered rows */
	--rots-raised-hi: #2a343f;
	--rots-sunken: #0a0d10;      /* wells: inputs, rail */
	--rots-border: #33404c;      /* hairline */
	--rots-border-hi: #4a5967;
	--rots-text: #d8dde2;
	--rots-text-hi: #ffffff;
	--rots-text-2: #9aa6b2;
	--rots-muted: #6b7783;
	--rots-gold: #e8b04a;        /* selection, focus, key numbers */
	--rots-gold-hi: #f5c76a;
	--rots-gold-soft: rgba(232, 176, 74, .15);
	--rots-gold-line: rgba(232, 176, 74, .5);
	--rots-red: #db1f1f;         /* RTSAccent */
	--rots-red-from: #ed3329;    /* RTSButtonStylePrimary */
	--rots-red-to: #9e0d0d;
	--rots-red-glow: rgba(219, 31, 31, .45);
	--rots-red-soft: rgba(200, 36, 30, .2);
	--rots-ok: #6dbe45;
	--rots-radius: 2px;
	--rots-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: dark;
}

/* ---------- Base ---------- */
html.dark-mode,
html.dark-mode body {
	background-color: var(--rots-bg);
}
html.dark-mode body {
	font-family: var(--rots-font);
	color: var(--rots-text);
	-webkit-font-smoothing: antialiased;
}
html.dark-mode { scrollbar-color: var(--rots-border) var(--rots-sunken); }
html.dark-mode:not(.touch) ::-webkit-scrollbar-track { background-color: var(--rots-sunken); }
html.dark-mode:not(.touch) ::-webkit-scrollbar-thumb { background-color: var(--rots-border); }
html.dark-mode:not(.touch) ::-webkit-scrollbar-thumb:hover { background-color: var(--rots-border-hi); }
html.dark-mode ::selection { background: var(--rots-red); color: #fff; }
html.dark-mode a { color: var(--rots-gold-hi); }
html.dark-mode a:hover { color: #fff; }
html.dark-mode #logo { opacity: 1; }

/* Uppercase military captions: the game's title style (800, tracked). */
html.dark-mode #layout > div > .header .header-title,
html.dark-mode .ui-dialog .ui-dialog-titlebar .ui-dialog-title,
html.dark-mode .popover-header,
html.dark-mode .formcontent legend,
html.dark-mode fieldset > legend,
html.dark-mode .listing thead td,
html.dark-mode .boxtitle {
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* ---------- Left rail (task menu) ---------- */
html.dark-mode #layout-menu {
	background: var(--rots-sunken);
	border-right: 1px solid var(--rots-border);
	box-shadow: inset -2px 0 0 rgba(219, 31, 31, .35);
}
@media screen and (min-width: 481px) {
	html.dark-mode #layout-menu .popover-header {
		background-color: var(--rots-sunken) !important;
		border-bottom: 1px solid var(--rots-border);
	}
	/* Rail emblem: the square ROTS app icon in a steel socket. */
	html.dark-mode #layout-menu .popover-header img {
		width: 52px;
		height: 52px;
		max-width: none;
		padding: 0;
		margin-top: 3px;
		border: 1px solid var(--rots-border);
		border-radius: 8px;
		box-shadow: 0 0 0 2px var(--rots-sunken), 0 0 14px rgba(219, 31, 31, .35);
		vertical-align: middle;
	}
	html.dark-mode #taskmenu .special-buttons { box-sizing: border-box; width: 77px; padding: 5px 5px 0; background-color: var(--rots-sunken); border-top: 1px solid var(--rots-border); }
	html.dark-mode #taskmenu .special-buttons a,
	html.dark-mode #taskmenu .special-buttons a:not(:focus) { margin: 0 0 5px !important; }
	/* Task buttons are bevelled steel tiles, like the game's compact panel buttons (RTSButtonStyleCompact). */
	html.dark-mode #taskmenu a,
	html.dark-mode #taskmenu .special-buttons a:not(:focus) {
		width: auto !important;
		margin: 0 5px 5px;
		color: var(--rots-text-2);
		position: relative;
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
		background: linear-gradient(180deg, #1c232b, #11161b);
		border: 1px solid var(--rots-border);
		border-radius: var(--rots-radius);
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 0 rgba(0, 0, 0, .6);
	}
	html.dark-mode #taskmenu span.inner { font-size: .66rem; }
	html.dark-mode #taskmenu a:hover,
	html.dark-mode #taskmenu a:focus,
	html.dark-mode #taskmenu .special-buttons a:hover {
		color: #fff;
		background: linear-gradient(180deg, #26303a, #171d24);
		border-color: var(--rots-gold-line);
	}
	/* Selected task: RTSButtonStyleMenu, a red edge fading into the dark, with an amber marker. */
	html.dark-mode #taskmenu a.selected,
	html.dark-mode #taskmenu a.selected:hover {
		color: #fff;
		background: linear-gradient(90deg, rgba(219, 31, 31, .95) 0, rgba(89, 10, 10, .85) 60%, rgba(30, 8, 8, .9) 100%);
		border-color: rgba(255, 90, 80, .55);
		box-shadow: inset 3px 0 0 var(--rots-gold), 0 0 12px rgba(219, 31, 31, .35);
	}
	/* Compose: the primary call to action, a red tile. */
	html.dark-mode #taskmenu .action-buttons a,
	html.dark-mode #taskmenu .action-buttons a:hover {
		color: #fff;
		background: linear-gradient(180deg, var(--rots-red-from), var(--rots-red-to));
		border-color: rgba(255, 255, 255, .18);
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 10px var(--rots-red-glow);
		margin: 8px 5px 10px;
	}
	html.dark-mode #taskmenu .action-buttons a:hover { filter: brightness(1.12); }
	html.dark-mode #taskmenu .action-buttons a.selected { box-shadow: inset 3px 0 0 var(--rots-gold), 0 3px 10px var(--rots-red-glow); }
	html.dark-mode #taskmenu a.logout,
	html.dark-mode #taskmenu a.logout:hover { color: #ff6b5f !important; }
}
/* Phone: the task menu is a slide-in sheet. */
html.dark-mode.layout-phone #layout-menu { background: var(--rots-panel); }
html.dark-mode.layout-phone #layout-menu .popover-header {
	background: var(--rots-sunken) !important;
	border-bottom: 2px solid var(--rots-red);
	height: 72px;
	line-height: 72px;
}
html.dark-mode.layout-phone #layout-menu .popover-header img { max-height: 64px; }
@media screen and (max-width: 480px) {
	html.dark-mode #taskmenu a {
		color: var(--rots-text);
		border-color: var(--rots-border) !important;
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
		font-size: 1rem;
	}
	html.dark-mode #taskmenu a.selected { color: #fff; background: linear-gradient(90deg, rgba(219, 31, 31, .95) 0, rgba(89, 10, 10, .75) 55%, rgba(0, 0, 0, .35) 100%); }
	html.dark-mode #taskmenu .action-buttons a { color: var(--rots-gold-hi); }
}

/* ---------- Panels and header bars ---------- */
html.dark-mode #layout-sidebar { background-color: var(--rots-panel); border-color: var(--rots-border); }
html.dark-mode #layout-list { background-color: var(--rots-bg); border-color: var(--rots-border); }
html.dark-mode #layout-content { background-color: var(--rots-bg); border-color: var(--rots-border); }
html.dark-mode #layout > div > .header,
html.dark-mode #layout > div > .footer {
	background: linear-gradient(180deg, var(--rots-panel-from), var(--rots-panel));
	border-color: var(--rots-border);
}
html.dark-mode #layout > div > .header {
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(219, 31, 31, .55);
}
html.dark-mode #layout > div > .header .header-title { color: #fff; font-size: .95rem; }
html.dark-mode #layout-sidebar > .header .header-title.username { color: var(--rots-gold); font-size: .85rem; }
html.dark-mode #layout > div > .footer { color: var(--rots-text-2); }

/* Toolbar buttons in header bars. */
html.dark-mode .menu.toolbar a,
html.dark-mode #layout > div > .header a.button { color: var(--rots-text); }
html.dark-mode .menu.toolbar a .inner,
html.dark-mode #layout > div > .header a.button .inner { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
html.dark-mode .menu.toolbar a:not(.disabled):hover,
html.dark-mode .menu.toolbar a:not(.disabled):focus,
html.dark-mode .header a.button.icon:not(.disabled):hover,
html.dark-mode .header a.button.icon:not(.disabled):focus { background-color: var(--rots-raised); color: #fff; }
html.dark-mode .menu.toolbar a.selected { color: var(--rots-gold); background: transparent; }
html.dark-mode .menu.toolbar a.disabled,
html.dark-mode .menu.toolbar a.disabled:before { color: var(--rots-muted); opacity: .7; }

/* Search bar: a sunken well with an amber focus line. */
html.dark-mode .searchbar { background-color: var(--rots-sunken); border-color: var(--rots-border); }
html.dark-mode .searchbar form:before { color: var(--rots-muted); }
html.dark-mode .searchbar:focus-within { box-shadow: inset 0 -2px 0 var(--rots-gold); }
html.dark-mode .searchbar input::placeholder { color: var(--rots-muted); }
html.dark-mode .searchbar a.selected { color: var(--rots-gold); }

/* ---------- Lists (folders, messages, contacts, settings) ---------- */
html.dark-mode .listing li,
html.dark-mode .listing tbody td,
html.dark-mode .listing li ul { border-color: rgba(255, 255, 255, .05); }
html.dark-mode .listing li a,
html.dark-mode .listing tbody td,
html.dark-mode .listing tbody td a { color: var(--rots-text); }
html.dark-mode .listing li:not(.selected) > a:hover,
html.dark-mode .listing tbody tr:not(.selected):hover td { background-color: rgba(255, 255, 255, .035); }
html.dark-mode .listing li.selected,
html.dark-mode .listing li.selected > a,
html.dark-mode .listing li.selected > div > a,
html.dark-mode .listing tr.selected td {
	color: #fff;
	background-color: var(--rots-gold-soft);
}
html.dark-mode .listing li.selected > a,
html.dark-mode .listing tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--rots-gold); }
html.dark-mode .listing li.selected ul { background-color: transparent; }
html.dark-mode .listing li.focused > a,
html.dark-mode .listing tr.focused > td { outline-color: var(--rots-gold-line); }

/* Folder list */
html.dark-mode .folderlist li.mailbox > a { font-weight: 600; }
html.dark-mode .folderlist li.mailbox > a:before { color: var(--rots-text-2); }
html.dark-mode .folderlist li.mailbox.selected > a:before { color: var(--rots-gold); }
html.dark-mode .folderlist li.mailbox.unread > a { color: #fff; font-weight: 800; }
html.dark-mode .folderlist li.mailbox .unreadcount,
html.dark-mode .folderlist li.mailbox.recent > a > .unreadcount {
	background: var(--rots-red);
	color: #fff;
	border: 1px solid rgba(0, 0, 0, .5);
	border-radius: 8px;
	font-weight: 800;
	font-size: .75rem;
}

/* Message list */
html.dark-mode .messagelist tr.unread td.subject span.subject a { color: #fff; font-weight: 800; }
html.dark-mode .messagelist tr:not(.flagged):not(.deleted) td.subject span.msgicon.status.unread { color: var(--rots-gold); }
html.dark-mode .messagelist tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--rots-red); }
html.dark-mode .messagelist tr.unread.selected td:first-child { box-shadow: inset 3px 0 0 var(--rots-gold); }
html.dark-mode .messagelist tr:not(.flagged):not(.deleted) td.subject span.date,
html.dark-mode .messagelist tr:not(.flagged):not(.deleted) td.subject span.size { color: var(--rots-text-2); font-variant-numeric: tabular-nums; }
html.dark-mode .messagelist tr:not(.flagged):not(.deleted) td.subject span.fromto { color: var(--rots-text-2); font-weight: 600; }
html.dark-mode .messagelist tr.flagged:not(.deleted) td,
html.dark-mode .messagelist tr.flagged:not(.deleted) td a { color: #ff6b5f; }

/* Page navigation and quota under lists */
html.dark-mode .menu.pagenav a { color: var(--rots-text-2); }
html.dark-mode .quota-widget .bar { background-color: var(--rots-sunken); border: 1px solid var(--rots-border); }
html.dark-mode .quota-widget .value { background-color: var(--rots-gold); }

/* ---------- Message view ---------- */
html.dark-mode #message-header { border-color: var(--rots-border); }
html.dark-mode #message-header h2.subject {
	color: #fff;
	font-weight: 800;
	letter-spacing: -.01em;
}
html.dark-mode #message-header .header .from,
html.dark-mode #message-header .header a.rcmContactAddress { color: var(--rots-gold-hi); }
html.dark-mode #message-header .header-headers .header-title { color: var(--rots-text-2); }
html.dark-mode #message-header .header-links a { color: var(--rots-text-2); }
html.dark-mode #message-header .header-links a:hover { color: #fff; }
html.dark-mode #message-content .header-content .short-header { color: var(--rots-text-2); }
html.dark-mode .message-part { border-color: var(--rots-border); }
html.dark-mode .message-part blockquote { background-color: var(--rots-panel); border-color: var(--rots-gold); color: var(--rots-gold-hi); }
html.dark-mode .message-htmlpart {
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
html.dark-mode .message-partheaders { background-color: var(--rots-panel); border: 1px solid var(--rots-border); }
html.dark-mode #attachment-list li,
html.dark-mode .attachmentslist li {
	background-color: var(--rots-panel);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
}
html.dark-mode .attachmentslist li a { color: var(--rots-text); }
html.dark-mode .contactphoto,
html.dark-mode #message-header .contactphoto { border: 1px solid var(--rots-border); }

/* ---------- Buttons ---------- */
html.dark-mode .btn,
html.dark-mode button.button,
html.dark-mode .ui-dialog .ui-dialog-buttonpane button {
	border-radius: var(--rots-radius);
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	font-size: .8rem;
}
/* Primary: RTSButtonStylePrimary (red gradient left to right, red glow). */
html.dark-mode .btn-primary,
html.dark-mode .btn-primary.disabled,
html.dark-mode .btn-primary:disabled,
html.dark-mode button.button.mainaction,
html.dark-mode .button.mainaction {
	color: #fff;
	background: linear-gradient(90deg, var(--rots-red-from), var(--rots-red-to));
	border: 1px solid rgba(255, 255, 255, .12);
	box-shadow: 0 3px 10px var(--rots-red-glow);
}
html.dark-mode .btn-primary:hover,
html.dark-mode .btn-primary:focus,
html.dark-mode .btn-primary:not(:disabled):not(.disabled):active,
html.dark-mode .btn-primary:not(:disabled):not(.disabled).active,
html.dark-mode button.button.mainaction:hover,
html.dark-mode button.button.mainaction:focus {
	color: #fff;
	background: linear-gradient(90deg, #ff4a3c, #b81414);
	border-color: rgba(255, 255, 255, .2);
	box-shadow: 0 3px 14px rgba(237, 51, 41, .6), 0 0 0 .2rem rgba(232, 176, 74, .35);
}
html.dark-mode .btn-primary:disabled { opacity: .45; box-shadow: none; }
/* Secondary: raised steel with a hairline. */
html.dark-mode .btn-secondary,
html.dark-mode .btn-secondary.disabled,
html.dark-mode .btn-secondary:disabled {
	color: var(--rots-text);
	background: var(--rots-raised);
	border: 1px solid var(--rots-border);
}
html.dark-mode .btn-secondary:hover,
html.dark-mode .btn-secondary:focus,
html.dark-mode .btn-secondary:not(:disabled):not(.disabled):active {
	color: #fff;
	background: var(--rots-raised-hi);
	border-color: var(--rots-border-hi);
	box-shadow: 0 0 0 .2rem rgba(232, 176, 74, .25);
}
html.dark-mode .btn-danger { background: #7a1a16; border-color: #a3241e; color: #fff; }
html.dark-mode .btn-danger:hover { background: #a3241e; }

/* Floating compose button on touch screens. */
html.dark-mode .floating-action-buttons a.button {
	background: linear-gradient(135deg, var(--rots-red-from), var(--rots-red-to));
	box-shadow: 0 4px 14px var(--rots-red-glow);
	border: 1px solid rgba(255, 255, 255, .15);
	border-radius: 16px;
}

/* ---------- Forms ---------- */
html.dark-mode .form-control,
html.dark-mode .custom-select,
html.dark-mode input[type=text],
html.dark-mode input[type=password],
html.dark-mode input[type=email],
html.dark-mode textarea,
html.dark-mode select {
	color: var(--rots-text-hi);
	background-color: var(--rots-sunken);
	border-color: var(--rots-border);
	border-radius: var(--rots-radius);
}
html.dark-mode .form-control:focus,
html.dark-mode .custom-select:focus,
html.dark-mode textarea:focus,
html.dark-mode select:focus,
html.dark-mode .recipient-input.focus {
	color: #fff;
	background-color: #0c1014;
	border-color: var(--rots-gold);
	box-shadow: 0 0 0 .2rem rgba(232, 176, 74, .2);
}
html.dark-mode .form-control::placeholder { color: var(--rots-muted); }
html.dark-mode .input-group-text,
html.dark-mode .input-group > .input-group-prepend > .input-group-text,
html.dark-mode .input-group > .input-group-append > .input-group-text {
	background-color: var(--rots-raised);
	border-color: var(--rots-border);
	color: var(--rots-text-2);
	border-radius: var(--rots-radius);
}
html.dark-mode .recipient-input { background-color: var(--rots-sunken); border-color: var(--rots-border); border-radius: var(--rots-radius); }
html.dark-mode .recipient-input li.recipient { background-color: var(--rots-raised); border: 1px solid var(--rots-border); color: var(--rots-text-hi); }
html.dark-mode .custom-control-input:checked ~ .custom-control-label:before,
html.dark-mode input.custom-control-input:checked + label:before,
html.dark-mode .custom-switch .custom-control-input:checked ~ .custom-control-label:before {
	background-color: var(--rots-red);
	border-color: var(--rots-red);
}
html.dark-mode input[type=checkbox]:checked,
html.dark-mode input[type=radio]:checked { accent-color: var(--rots-red); }
html.dark-mode .formcontent legend,
html.dark-mode fieldset > legend {
	color: var(--rots-gold);
	font-size: .8rem;
	border-bottom: 1px solid var(--rots-border);
	padding-bottom: .35rem;
}
html.dark-mode .propform .col-form-label,
html.dark-mode table.propform td.title,
html.dark-mode .formcontent label { color: var(--rots-text-2); }

/* Compose */
html.dark-mode #compose-headers .form-group,
html.dark-mode #compose-content .form-group { border-color: var(--rots-border); }
html.dark-mode #compose-subject { font-weight: 700; }
html.dark-mode .editor-toolbar,
html.dark-mode .tox .tox-toolbar,
html.dark-mode .tox .tox-toolbar__primary,
html.dark-mode .tox .tox-menubar { background: var(--rots-panel) !important; }
html.dark-mode #compose-attachments,
html.dark-mode #compose-options { border-color: var(--rots-border); }

/* ---------- Popovers, menus, dialogs ---------- */
html.dark-mode .popover {
	background-color: var(--rots-panel);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
	box-shadow: 0 12px 28px rgba(0, 0, 0, .6);
}
html.dark-mode .popover .popover-body { background-color: var(--rots-panel); }
html.dark-mode .popupmenu .listing li > a { color: var(--rots-text); }
html.dark-mode .popupmenu .listing li > a:not(.disabled):hover,
html.dark-mode .popover .menu a:not(.disabled):hover,
html.dark-mode .popover .menu a:not(.disabled):focus { background-color: var(--rots-gold-soft); color: #fff; }
html.dark-mode .popover .menu a.disabled { color: var(--rots-muted); }
html.dark-mode .ui-dialog {
	background-color: var(--rots-panel);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .7);
}
html.dark-mode .ui-dialog .ui-dialog-titlebar {
	background: linear-gradient(180deg, var(--rots-panel-from), var(--rots-panel));
	border-color: var(--rots-border);
}
html.dark-mode .ui-dialog .ui-dialog-titlebar .ui-dialog-title { color: #fff; font-size: .95rem; }
html.dark-mode .ui-dialog .ui-dialog-buttonpane { background-color: var(--rots-panel); border-color: var(--rots-border); }
html.dark-mode .ui-widget-overlay { background: rgba(5, 8, 11, .78); }

/* Notifications (bottom-right message stack): banner fill with a coloured edge. */
html.dark-mode #messagestack div {
	background-color: rgba(13, 13, 13, .92);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--rots-radius);
	color: var(--rots-text);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .5);
}
html.dark-mode #messagestack .alert-info { background-color: rgba(13, 13, 13, .94); box-shadow: inset 3px 0 0 var(--rots-gold), 0 8px 18px rgba(0, 0, 0, .5); }
html.dark-mode #messagestack .alert-success { background-color: rgba(13, 13, 13, .94); box-shadow: inset 3px 0 0 var(--rots-ok), 0 8px 18px rgba(0, 0, 0, .5); }
html.dark-mode #messagestack .alert-warning { background-color: rgba(13, 13, 13, .94); box-shadow: inset 3px 0 0 #ffb833, 0 8px 18px rgba(0, 0, 0, .5); }
html.dark-mode #messagestack .alert-danger { background-color: rgba(13, 13, 13, .94); box-shadow: inset 3px 0 0 var(--rots-red), 0 8px 18px rgba(0, 0, 0, .5); }

/* ---------- Login ---------- */
html.dark-mode body.task-login {
	background: var(--rots-bg);
	min-height: 100vh;
}
html.dark-mode body.task-login::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	background:
		radial-gradient(ellipse at 50% 40%, rgba(7, 8, 12, .35) 0%, rgba(7, 8, 12, .8) 70%, rgba(7, 8, 12, .95) 100%),
		linear-gradient(180deg, rgba(7, 8, 12, .55) 0%, rgba(7, 8, 12, .45) 45%, rgba(7, 8, 12, .9) 100%),
		url("../images/login-bg.webp") center / cover no-repeat;
	filter: saturate(.85);
}
@media screen and (max-width: 900px) {
	html.dark-mode body.task-login::before {
		background:
			radial-gradient(ellipse at 50% 40%, rgba(7, 8, 12, .35) 0%, rgba(7, 8, 12, .8) 70%, rgba(7, 8, 12, .95) 100%),
			linear-gradient(180deg, rgba(7, 8, 12, .55) 0%, rgba(7, 8, 12, .45) 45%, rgba(7, 8, 12, .9) 100%),
			url("../images/login-bg-900.webp") center / cover no-repeat;
	}
}
html.dark-mode body.task-login #layout,
html.dark-mode body.task-login #layout-content {
	position: relative;
	z-index: 1;
	background: transparent;
}
html.dark-mode body.task-login #layout-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 2rem 16px;
	overflow-y: auto;
}
.task-login #logo {
	top: 0;
	max-height: none;
	width: 300px;
	max-width: 80vw;
	height: auto;
	margin-bottom: 1.25rem;
	filter: drop-shadow(0 6px 24px rgba(219, 31, 31, .35));
}
html.dark-mode #login-form {
	top: 0;
	width: 100%;
	max-width: 380px;
	padding: 1.5rem 1.5rem 1.25rem;
	background: rgba(20, 26, 32, .88);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .05);
	text-align: left;
}
html.dark-mode #login-form::before {
	content: "Staff access";
	display: block;
	margin: 0 0 1rem;
	padding-bottom: .6rem;
	border-bottom: 1px solid var(--rots-border);
	color: var(--rots-gold);
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .18em;
	text-transform: uppercase;
}
html.dark-mode #login-form table td.title { display: none; }
html.dark-mode #login-form table td.input { padding: 0 0 .75rem; }
html.dark-mode #login-form .form-control {
	height: 46px;
	padding: 0 .9rem;
	font-size: 1rem;
	background-color: rgba(10, 13, 16, .9);
}
html.dark-mode #login-form .formbuttons { margin: .25rem 0 0; }
html.dark-mode #rcmloginsubmit {
	display: block;
	width: 100%;
	height: 48px;
	font-size: .95rem;
	letter-spacing: .12em;
}
html.dark-mode #login-footer {
	margin-top: 1.25rem;
	padding-top: .9rem;
	border-top: 1px solid var(--rots-border);
	color: var(--rots-muted);
	font-size: .8rem;
	text-align: center;
	letter-spacing: .04em;
}
html.dark-mode #login-footer a { color: var(--rots-text-2); }
html.dark-mode #login-footer a:hover { color: var(--rots-gold-hi); }
html.dark-mode #login-form .oauthlogin { border-color: var(--rots-border); }

/* Phones: no header bar shadow tricks, larger touch rows. */
html.dark-mode.layout-phone #layout > div > .header { box-shadow: inset 0 -2px 0 rgba(219, 31, 31, .55); }
html.dark-mode.layout-phone .task-login #logo { width: 240px; }

/* =====================================================================================================================
 * Command console details (v2): bevelled frames, corner brackets, hatched header bars, game-style states.
 * ===================================================================================================================== */
:root {
	/* Amber corner brackets, layered over any panel fill: background: var(--rots-corners), <fill>; */
	--rots-corners:
		linear-gradient(var(--rots-gold), var(--rots-gold)) left top / 14px 2px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) left top / 2px 14px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) right top / 14px 2px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) right top / 2px 14px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) left bottom / 14px 2px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) left bottom / 2px 14px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) right bottom / 14px 2px no-repeat,
		linear-gradient(var(--rots-gold), var(--rots-gold)) right bottom / 2px 14px no-repeat;
	--rots-hatch: repeating-linear-gradient(135deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 9px);
	--rots-panel-fill: linear-gradient(180deg, var(--rots-panel-from), var(--rots-panel));
}

/* Narrow rail (tablets): 42 px wide, so smaller tiles and emblem. */
@media screen and (min-width: 481px) and (max-width: 1024px) {
	html.dark-mode #taskmenu a,
	html.dark-mode #taskmenu .special-buttons a:not(:focus) { margin: 0 3px 3px; }
	html.dark-mode #taskmenu .special-buttons { width: 41px; padding: 3px 3px 0; }
	html.dark-mode #taskmenu .action-buttons a,
	html.dark-mode #taskmenu .action-buttons a:hover { margin: 6px 3px 8px; }
	html.dark-mode #layout-menu .popover-header img { width: 34px; height: 34px; border-radius: 6px; margin-top: 0; }
}

/* Header bars: steel with a faint hatch, a bevel line on top and the red rule below. */
html.dark-mode #layout > div > .header {
	background: var(--rots-hatch), linear-gradient(180deg, #1d242c, #141a20);
}
html.dark-mode #layout > div > .header .header-title:not(:empty)::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 .55em .12em 0;
	background: var(--rots-red);
	box-shadow: 0 0 8px var(--rots-red-glow);
	vertical-align: middle;
}
/* Toolbar buttons light up like panel buttons on hover. */
html.dark-mode .header .menu.toolbar a:not(.disabled):hover,
html.dark-mode .header .menu.toolbar a:not(.disabled):focus,
html.dark-mode .header a.button.icon:not(.disabled):hover,
html.dark-mode .header a.button.icon:not(.disabled):focus {
	background: linear-gradient(180deg, #26303a, #171d24);
	box-shadow: inset 0 0 0 1px var(--rots-border-hi), inset 0 -2px 0 var(--rots-gold);
}
html.dark-mode .menu.toolbar .dropbutton a.dropdown:hover { background-color: var(--rots-raised-hi); }

/* List panes read as sunken wells; the sidebar is a raised panel. */
html.dark-mode #layout-sidebar { background: var(--rots-hatch), var(--rots-panel); }
html.dark-mode #layout-list .scroller,
html.dark-mode #layout-sidebar .scroller { background: transparent; }

/* Game list rows: separator lines, row hover, selected = amber fill and marker. */
html.dark-mode .listing tbody td,
html.dark-mode .listing li { border-color: rgba(255, 255, 255, .06); }
html.dark-mode .messagelist td.subject { padding-top: .45rem; padding-bottom: .45rem; }
html.dark-mode .listing tr.focused > td,
html.dark-mode .listing li.focused > a { outline: none; box-shadow: inset 0 1px 0 var(--rots-gold-line), inset 0 -1px 0 var(--rots-gold-line); }
html.dark-mode .listing tr.focused.selected > td:first-child,
html.dark-mode .listing li.focused.selected > a { box-shadow: inset 3px 0 0 var(--rots-gold), inset 0 1px 0 var(--rots-gold-line), inset 0 -1px 0 var(--rots-gold-line); }
html.dark-mode .listing-hover-menu {
	background-color: var(--rots-panel);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .55);
}
html.dark-mode .listing-hover-menu a.button { color: var(--rots-text); }

/* Empty states ("The list is empty", "No messages"): a dim emblem over a tracked caption. */
html.dark-mode .listing-info {
	color: var(--rots-text-2);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1.6;
	text-transform: uppercase;
}
html.dark-mode .listing-info::before {
	content: "";
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	background: url("../images/rots-icon.png") center / contain no-repeat;
	border-radius: 10px;
	opacity: .35;
	filter: grayscale(.6);
}

/* Page navigation footer */
html.dark-mode #layout > div > .footer { background: var(--rots-hatch), linear-gradient(180deg, #161c22, #0f1418); }
html.dark-mode .menu.pagenav .pagenav-text { color: var(--rots-text-2); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
html.dark-mode .pagenav input.form-control { height: 1.8rem; text-align: center; }

/* ---------- Message view: the header is a framed dialog panel ---------- */
html.dark-mode #message-header {
	position: relative;
	margin-bottom: .75rem;
	padding: .75rem 1rem .6rem;
	background: var(--rots-corners), var(--rots-hatch), var(--rots-panel-fill);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
html.dark-mode #message-header h2.subject { font-size: 1.25rem; margin-bottom: .5rem; }
html.dark-mode #message-header .header-links a { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
html.dark-mode #message-header .contactphoto { border-radius: 4px; background: var(--rots-sunken); }
/* HTML mail keeps its own (light) design, set in a steel bezel. */
html.dark-mode .message-htmlpart {
	margin: .75rem 6px 6px;
	border: 0;
	box-shadow: 0 0 0 6px var(--rots-panel), 0 0 0 7px var(--rots-border), 0 10px 24px rgba(0, 0, 0, .5);
}
html.dark-mode .message-part:not(.message-htmlpart) {
	padding: 1rem;
	background: var(--rots-sunken);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
}
html.dark-mode #messagebody .message-part div.pre { color: var(--rots-text); }

/* Inline notices (remote content blocked, errors): dark plate with a coloured edge, not a solid block. */
html.dark-mode .ui.alert.boxwarning,
html.dark-mode .ui.alert.boxinformation,
html.dark-mode .ui.alert.boxerror,
html.dark-mode .ui.alert.boxconfirmation {
	color: var(--rots-text);
	background-color: rgba(10, 13, 16, .85);
	border: 1px solid var(--rots-border);
	border-left: 3px solid var(--rots-gold);
	border-radius: var(--rots-radius);
}
html.dark-mode .ui.alert.boxwarning i.icon:before { color: #ffb833; }
html.dark-mode .ui.alert.boxinformation { border-left-color: var(--rots-gold); }
html.dark-mode .ui.alert.boxinformation i.icon:before { color: var(--rots-gold); }
html.dark-mode .ui.alert.boxerror { border-left-color: var(--rots-red); }
html.dark-mode .ui.alert.boxerror i.icon:before { color: #ff6b5f; }
html.dark-mode .ui.alert.boxconfirmation { border-left-color: var(--rots-ok); }
html.dark-mode .ui.alert.boxconfirmation i.icon:before { color: var(--rots-ok); }
html.dark-mode .ui.alert .btn { padding: .2rem .7rem; }

/* ---------- Forms (compose, settings, contacts) ---------- */
/* Field labels are game captions: small, bold, tracked, uppercase. */
html.dark-mode #compose-headers .col-form-label,
html.dark-mode .formcontent .col-form-label,
html.dark-mode table.propform td.title {
	color: var(--rots-text-2);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}
html.dark-mode #compose-options .col-form-label { color: var(--rots-text-2); font-size: .85rem; letter-spacing: 0; text-transform: none; hyphens: none; }
html.dark-mode #compose-headers {
	padding: .75rem 1rem .25rem;
	margin-bottom: .75rem;
	background: var(--rots-corners), var(--rots-panel-fill);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
}
html.dark-mode #compose-content .formbuttons .btn.send { padding: .55rem 1.6rem; font-size: .85rem; }
html.dark-mode .file-upload,
html.dark-mode #compose-attachments.file-upload { border-color: rgba(232, 176, 74, .35); }
html.dark-mode .file-upload:before { color: rgba(232, 176, 74, .25); }
html.dark-mode .editor-toolbar { border-color: var(--rots-border); }
html.dark-mode #composebody { background-color: var(--rots-sunken); }

/* Settings and contact forms: each fieldset is a framed panel with an amber caption. */
html.dark-mode .formcontent fieldset {
	position: relative;
	margin-bottom: 1rem;
	padding: .25rem 1rem .75rem;
	background: var(--rots-corners), var(--rots-panel-fill);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
}
html.dark-mode .formcontent fieldset > legend { float: left; width: 100%; margin-bottom: .5rem; padding-top: .75rem; }
html.dark-mode .formcontent fieldset > legend + * { clear: both; }
html.dark-mode .formcontent fieldset fieldset { background: transparent; border-color: rgba(255, 255, 255, .06); }
html.dark-mode .tabsbar,
html.dark-mode .nav-tabs { border-color: var(--rots-border); }
html.dark-mode .nav-tabs .nav-link {
	color: var(--rots-text-2);
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	border-radius: var(--rots-radius) var(--rots-radius) 0 0;
}
html.dark-mode .nav-tabs .nav-link.active {
	color: #fff;
	background-color: var(--rots-panel);
	border-color: var(--rots-border) var(--rots-border) var(--rots-panel);
	box-shadow: inset 0 2px 0 var(--rots-red);
}
html.dark-mode #contactpic,
html.dark-mode #contacthead .contactpic { background-color: var(--rots-sunken); border: 1px solid var(--rots-border); }
html.dark-mode #contacthead { border-color: var(--rots-border); }
html.dark-mode .custom-select { background-color: var(--rots-sunken); }
html.dark-mode .custom-switch .custom-control-label:before { background-color: var(--rots-sunken); border-color: var(--rots-border-hi); }
html.dark-mode .custom-switch .custom-control-input:checked ~ .custom-control-label:after { background-color: #fff; }
html.dark-mode .records-table,
html.dark-mode .table { color: var(--rots-text); border-color: var(--rots-border); }
html.dark-mode .records-table thead td,
html.dark-mode .table thead th { color: var(--rots-text-2); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Dialogs: framed console windows ---------- */
html.dark-mode .ui-dialog { background: var(--rots-corners), var(--rots-panel); }
html.dark-mode .ui-dialog .ui-dialog-titlebar { background: var(--rots-hatch), linear-gradient(180deg, #1d242c, #141a20); }
html.dark-mode .ui-dialog .ui-dialog-titlebar .ui-dialog-title::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 .55em .12em 0;
	background: var(--rots-red);
	vertical-align: middle;
}
html.dark-mode .ui-dialog .ui-dialog-content { background-color: transparent; }
html.dark-mode .ui-dialog .ui-dialog-titlebar-close,
html.dark-mode .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close {
	background: var(--rots-raised);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
	color: var(--rots-text);
}
html.dark-mode .ui-dialog .ui-dialog-titlebar-close:hover { border-color: var(--rots-red); color: #fff; }

/* About page (templates/about.html) */
.rots-about { text-align: center; }
.rots-about .rots-about-logo { width: 240px; max-width: 70%; height: auto; margin: .5rem auto .75rem; display: block; filter: drop-shadow(0 6px 20px rgba(219, 31, 31, .3)); }
html.dark-mode .rots-about h2.sysname { color: #fff; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 1.1rem; margin: 0; }
html.dark-mode .rots-about .rots-about-tag { color: var(--rots-gold); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: .35rem 0 1.25rem; }
html.dark-mode .rots-about .rots-legal {
	text-align: left;
	margin-top: 1rem;
	padding: .75rem 1rem;
	background: var(--rots-sunken);
	border: 1px solid var(--rots-border);
	border-radius: var(--rots-radius);
	color: var(--rots-muted);
	font-size: .75rem;
}
/* Legal notices stay reachable (GPL "Appropriate Legal Notices") but collapsed by default. */
html.dark-mode .rots-about .rots-legal summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	margin: -.75rem -1rem;
	padding: 0 1rem;
	color: var(--rots-text-2);
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}
html.dark-mode .rots-about .rots-legal summary::-webkit-details-marker { display: none; }
html.dark-mode .rots-about .rots-legal summary::after { content: "+"; margin-left: auto; color: var(--rots-gold); font-size: 1rem; }
html.dark-mode .rots-about .rots-legal[open] summary { margin-bottom: .5rem; border-bottom: 1px solid var(--rots-border); }
html.dark-mode .rots-about .rots-legal[open] summary::after { content: "\2212"; }
html.dark-mode .rots-about .rots-legal summary:hover { color: #fff; }
html.dark-mode .rots-about .rots-legal p { margin: 0 0 .4rem; }
html.dark-mode .rots-about .rots-legal a { color: var(--rots-text-2); }

/* ---------- Loading: red spinner, console toast ---------- */
html.dark-mode .iframe-loader { background-color: rgba(14, 18, 22, .9); }
html.dark-mode .iframe-loader .spinner-border {
	width: 4rem;
	height: 4rem;
	border-width: .35rem;
	color: var(--rots-red);
	border-color: currentColor rgba(255, 255, 255, .08) rgba(255, 255, 255, .08) rgba(255, 255, 255, .08);
	filter: drop-shadow(0 0 8px var(--rots-red-glow));
}
html.dark-mode #messagestack .loading {
	background-color: rgba(13, 13, 13, .94);
	box-shadow: inset 3px 0 0 var(--rots-red), 0 8px 18px rgba(0, 0, 0, .5);
}
html.dark-mode #messagestack div { font-weight: 600; letter-spacing: .02em; }

/* Thin steel scrollbars on desktop */
html.dark-mode:not(.touch) ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark-mode:not(.touch) ::-webkit-scrollbar-thumb { border: 2px solid var(--rots-sunken); border-radius: 5px; }

/* Login: corner brackets on the access panel */
html.dark-mode #login-form { background: var(--rots-corners), rgba(20, 26, 32, .88); }

/* Phone: the menu sheet header carries the emblem and the product name. */
html.dark-mode.layout-phone #layout-menu .popover-header img { width: 48px; height: 48px; max-height: none; border: 1px solid var(--rots-border); border-radius: 8px; }
html.dark-mode.layout-phone #layout-menu .popover-header::after {
	content: "ROTS Mail";
	order: 1;
	margin-left: .75rem;
	color: #fff;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-size: .95rem;
}
html.dark-mode.layout-phone #layout-menu .popover-header a { order: 2; }
@media screen and (max-width: 480px) {
	html.dark-mode #taskmenu a { background: linear-gradient(180deg, #1a2027, #12171c); margin: 0 8px 6px; border: 1px solid var(--rots-border) !important; border-radius: var(--rots-radius); width: auto; }
	html.dark-mode #taskmenu a.selected { border-color: rgba(255, 90, 80, .55) !important; box-shadow: inset 3px 0 0 var(--rots-gold); }
	html.dark-mode #taskmenu .action-buttons a { color: #fff; background: linear-gradient(90deg, var(--rots-red-from), var(--rots-red-to)); margin-top: 10px; }
	html.dark-mode #message-header { padding: .6rem .75rem .5rem; }
	html.dark-mode #compose-headers .col-form-label { font-size: .8rem; letter-spacing: 0; text-transform: none; hyphens: none; }
	html.dark-mode .message-htmlpart { margin-left: 4px; margin-right: 4px; }
}

/* =====================================================================================================================
 * Touch screens (phones, tablets, landscape phones): 44 px tap targets, 14 px minimum text, 16 px inputs (no iOS zoom
 * on focus), the floating compose button never hides the last row, wide HTML mail scrolls inside its bezel.
 * elastic adds html.touch on touch devices and html.layout-phone / layout-small / layout-normal by width.
 * ===================================================================================================================== */
html.dark-mode .ui-dialog { box-sizing: border-box; max-width: 100vw; }
html.dark-mode #messagebody .message-htmlpart { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Header bars: titles and icon buttons */
html.dark-mode.touch #layout > div > .header .header-title,
html.dark-mode.touch .header .voice + .header-title { font-size: 15px; }
html.dark-mode.touch #layout > div > .header a.button.icon,
html.dark-mode.touch #layout > div > .header .menu.toolbar a { min-width: 44px; min-height: 44px; text-align: center; }
html.dark-mode.touch .menu.toolbar a .inner,
html.dark-mode.touch #layout > div > .header a.button .inner,
html.dark-mode.touch #layout > div > .footer .menu.toolbar a .inner { font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: none; }
html.dark-mode.touch #layout > div > .footer .menu.toolbar a { min-height: 44px; }

/* Search wells */
html.dark-mode.touch .searchbar { min-height: 44px; }
html.dark-mode.touch .searchbar input { height: 44px; font-size: 16px; }
html.dark-mode.touch .searchbar a.button,
html.dark-mode.touch .searchbar .options { min-width: 44px; min-height: 44px; }

/* Message list: bigger names and dates, room under the last row for the floating compose button */
html.dark-mode.touch .messagelist td.subject span.fromto,
html.dark-mode.touch .messagelist td.subject span.date,
html.dark-mode.touch .messagelist td.subject span.size,
html.dark-mode.touch .messagelist .rcmContactAddress { font-size: 14px; }
html.dark-mode.touch .messagelist td.subject span.subject,
html.dark-mode.touch .messagelist td.subject span.subject a { font-size: 15px; }
html.dark-mode.touch .messagelist td.subject { padding-top: .6rem; padding-bottom: .6rem; }
html.dark-mode.touch #layout-list .scroller { padding-bottom: 88px; }
html.dark-mode.touch .floating-action-buttons { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
html.dark-mode.touch .listing-info,
html.dark-mode.touch #rcmcountdisplay,
html.dark-mode.touch .menu.pagenav .pagenav-text,
html.dark-mode.touch #layout > div > .footer { font-size: 14px; }
html.dark-mode.touch #layout > div > .footer.small { height: 46px; min-height: 46px; line-height: 46px; }
html.dark-mode.touch .menu.pagenav a { min-width: 44px !important; height: 44px; }
html.dark-mode.touch .menu.pagenav a:before { line-height: 44px; }
html.dark-mode.touch .pagenav input.form-control { height: 36px; font-size: 16px; }

/* Message view */
html.dark-mode.touch #message-header .header-links a,
html.dark-mode.touch #message-header .header-links a .inner { font-size: 14px; letter-spacing: .02em; text-transform: none; }
html.dark-mode.touch #message-header .header-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; }
html.dark-mode.touch #message-header .header .from,
html.dark-mode.touch #message-header .header a.rcmContactAddress { display: inline-block; min-height: 44px; line-height: 44px; }
html.dark-mode.touch .ui.alert .btn { min-height: 44px; padding: .4rem 1rem; font-size: 14px; }
html.dark-mode.touch .ui.alert { font-size: 14px; }

/* Forms: readable labels, 44 px fields with 16 px text */
html.dark-mode.touch #compose-headers .col-form-label,
html.dark-mode.touch .formcontent .col-form-label,
html.dark-mode.touch table.propform td.title,
html.dark-mode.touch .propform .col-form-label,
html.dark-mode.touch .formcontent label,
html.dark-mode.touch #compose-options .col-form-label { font-size: 14px; letter-spacing: .02em; text-transform: none; font-weight: 600; }
html.dark-mode.touch .formcontent legend,
html.dark-mode.touch fieldset > legend,
html.dark-mode.touch .boxtitle { font-size: 14px; }
html.dark-mode.touch .form-control,
html.dark-mode.touch .custom-select,
html.dark-mode.touch input[type=text],
html.dark-mode.touch input[type=password],
html.dark-mode.touch input[type=email],
html.dark-mode.touch select { min-height: 44px; font-size: 16px; }
html.dark-mode.touch textarea { font-size: 16px; }
html.dark-mode.touch .recipient-input { min-height: 44px; }
html.dark-mode.touch .recipient-input input { min-height: 40px; font-size: 16px; }
html.dark-mode.touch .input-group-text.icon,
html.dark-mode.touch .input-group > .input-group-append > a.input-group-text { min-width: 44px; min-height: 44px; justify-content: center; }
html.dark-mode.touch .btn,
html.dark-mode.touch button.button,
html.dark-mode.touch .ui-dialog .ui-dialog-buttonpane button { min-height: 44px; font-size: 14px; }
html.dark-mode.touch .custom-switch { min-height: 44px; display: flex; align-items: center; }
html.dark-mode.touch .custom-switch .custom-control-label { min-height: 44px; min-width: 50px; }
html.dark-mode.touch .editor-toolbar a,
html.dark-mode.touch a.mce-i-html { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
html.dark-mode.touch .custom-switch .custom-control-label::before,
html.dark-mode.touch .custom-switch .custom-control-label::after { top: 50%; transform: translateY(-50%); }
html.dark-mode.touch .custom-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translate(13px, -50%); }
html.dark-mode.touch .skinauthor,
html.dark-mode.touch .skinlicense { font-size: 14px; }

/* Dialogs and the About page */
html.dark-mode.touch .ui-dialog .ui-dialog-titlebar .ui-dialog-title { font-size: 15px; }
html.dark-mode.touch .ui-dialog .ui-dialog-titlebar-close { min-width: 44px; min-height: 44px; }
html.dark-mode.touch .rots-about .rots-about-tag,
html.dark-mode.touch .rots-about .rots-legal,
html.dark-mode.touch .rots-about .rots-legal summary { font-size: 14px; }

/* Login footer links */
html.dark-mode.touch #login-footer,
html.dark-mode.touch #rcmloginsubmit { font-size: 14px; }
html.dark-mode.touch #login-footer a { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 .5rem; }
html.dark-mode.touch #login-footer { padding-top: 0; }

/* Generic settings pages (plugins such as password and rots_setup: .boxtitle + .formcontent + table.propform without
 * fieldsets) get the same framed panel as the built-in preference sections. */
html.dark-mode .formcontainer .formcontent:not(:has(fieldset)) {
	margin: 0 0 1rem;
	padding: 1rem 1rem .5rem;
	background: var(--rots-corners), var(--rots-panel-fill);
	border: 1px solid var(--rots-border);
	border-top: 2px solid var(--rots-red);
	border-radius: var(--rots-radius);
}
html.dark-mode .formcontainer .formcontent,
html.dark-mode .formcontainer .formbuttons { max-width: 880px; }
html.dark-mode .boxtitle { color: var(--rots-gold); border-color: var(--rots-border); background: transparent; }
html.dark-mode .formcontent .hint,
html.dark-mode .formcontent p.hint,
html.dark-mode .formcontent .form-text { color: var(--rots-text-2); }
html.dark-mode .formcontent table.propform td { vertical-align: middle; }
html.dark-mode .formcontainer .formbuttons { padding-top: .25rem; }
html.dark-mode .boxwarning,
html.dark-mode .boxinformation,
html.dark-mode .boxerror,
html.dark-mode .boxconfirmation {
	color: var(--rots-text);
	background-color: rgba(10, 13, 16, .85);
	border: 1px solid var(--rots-border);
	border-left: 3px solid var(--rots-gold);
	border-radius: var(--rots-radius);
}
html.dark-mode .boxerror { border-left-color: var(--rots-red); }
html.dark-mode .boxconfirmation { border-left-color: var(--rots-ok); }
/* Phone footer toolbars: the form's main action reads as a gold command, not a narrow red block. */
html.dark-mode #layout > div > .footer a.button.mainaction,
html.dark-mode #layout > div > .footer a.button.mainaction:hover,
html.dark-mode #layout > div > .footer a.button.mainaction:focus {
	color: var(--rots-gold-hi);
	background: transparent;
	border: 0;
	box-shadow: none;
}
html.dark-mode #layout > div > .footer a.button.mainaction:before { color: var(--rots-gold-hi); }
html.dark-mode #layout > div > .footer a.button.mainaction .inner { color: var(--rots-gold-hi); }

/* Phone compose: a fixed 76 px label column so "Subject" fits at 14 px and the fields take the rest. */
html.dark-mode.layout-phone #compose-headers .form-group.row > .col-form-label { flex: 0 0 76px; max-width: 76px; padding-right: .35rem; }
html.dark-mode.layout-phone #compose-headers .form-group.row > .col-10 { flex: 1 1 0; max-width: none; min-width: 0; }
html.dark-mode.layout-phone #compose-headers { padding-left: .6rem; padding-right: .6rem; }
html.dark-mode.touch #message-header .header-links a,
html.dark-mode.touch #message-header a.extwin { min-width: 44px; }
html.dark-mode.touch #message-header a.extwin { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }

/* Touch tablets and landscape phones (481-1024 px): widen elastic's 42 px rail to 52 px so every tile is 44x44. */
@media screen and (min-width: 481px) and (max-width: 1024px) {
	html.dark-mode.touch #layout-menu { width: 52px; min-width: 52px; }
	html.dark-mode.touch #taskmenu a,
	html.dark-mode.touch #taskmenu .special-buttons a:not(:focus) { width: 44px !important; height: 44px; min-height: 44px; margin: 0 4px 4px !important; }
	html.dark-mode.touch #taskmenu .action-buttons a,
	html.dark-mode.touch #taskmenu .action-buttons a:hover { margin: 4px 4px 6px !important; }
	html.dark-mode.touch #taskmenu .special-buttons { width: 52px; padding: 4px 0 0; }
}
