/* ---- Verfassen wie im Desktop-Programm: Menüband, Empfänger, Dialoge ---- */
.calendar { grid-template-columns: 260px 1fr; }
.overlay.top { z-index: 40; }
.compose.big { width: min(1180px, 98vw); height: min(900px, 97vh); }
.ribtabs { align-items: center; position: relative; z-index: 36; }
.ribtabs > .menuwrap > button { border: 0; border-bottom: 2px solid transparent; background: transparent; border-radius: 0; padding: 6px 12px; }
.ribtabs > .menuwrap > button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tellme { position: relative; }
.tellme input { width: 220px; margin: 2px 6px; }
.composebar { align-items: stretch; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; padding: 2px 6px; position: relative; z-index: 35; min-height: 92px; }
.rgroup2 { display: flex; flex-direction: column; border-right: 1px solid var(--border); padding: 0 6px; flex: none; }
.rgroup2 .rbody { display: flex; align-items: stretch; gap: 1px; flex: 1; }
.rgroup2 .rcaption { text-align: center; font-size: 11px; color: var(--muted); padding: 1px 0; }
.stack { display: flex; flex-direction: column; justify-content: center; }
.srow { display: flex; }
.rsmall { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.rsmall .icon { color: var(--accent); }
.rsmall:hover:not(:disabled) { background: var(--selection); border-color: #b2dfdb; }
.rsmall.active, .rsmall.on { background: var(--selection); border-color: #b2dfdb; }
.rsmall:disabled { opacity: .45; cursor: default; }
.colorbtn2 { position: relative; cursor: pointer; }
.colorbtn2 input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ribbon.arrow { min-width: 16px; padding: 0 2px; align-self: stretch; }
.splitarrow { display: flex; }
.ribbon.off { opacity: .45; pointer-events: none; }
.sendbutton { background: var(--accent) !important; }
.commandbar.slim { align-items: center; min-height: 0; padding: 3px 8px; flex-wrap: wrap; }
.sendslim { background: var(--accent); border-color: var(--accent); color: #fff; padding: 4px 12px; }
.banner.imagesbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff4ce; color: #1e2426; }
.frow .recipients { flex: 1; min-width: 0; }
.recipients { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; position: relative; border-bottom: 1px solid var(--border); padding: 2px 2px; min-height: 30px; cursor: text; }
.recipients.focus { border-bottom: 2px solid var(--accent); }
.rchip { display: inline-flex; align-items: center; gap: 2px; background: var(--selection); border: 1px solid #b2dfdb; border-radius: 12px; padding: 0 4px 0 8px; font-size: 13px; }
.rchip.invalid { background: #fde7e7; border-color: #e6a5a5; color: #a11; }
.rchip .rx { border: 0; background: transparent; padding: 0 3px; color: inherit; cursor: pointer; }
.rinput { flex: 1; min-width: 120px; border: 0 !important; background: transparent !important; outline: none; padding: 4px 2px !important; }
.recipients .suggest { top: 100%; }
.suggest li.sel, .suggest li:hover { background: var(--selection); }
.greetingbar { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff4ce; color: #1e2426; border-radius: 3px; padding: 3px 8px; }
.greetingbar .from { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formatbar button.on { background: var(--selection); border-color: #b2dfdb; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border); background: var(--pane); }
.attachtile { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; min-width: 180px; max-width: 280px; }
.attachtile small { color: var(--muted); }
.popmenu.up { top: auto; bottom: 100%; }
.popmenu.wide { min-width: 340px; max-width: 520px; }
.popgrid { padding: 4px; max-height: 360px; overflow: auto; }
.gridwrap { display: flex; flex-wrap: wrap; gap: 2px; }
.gridwrap .cell { min-width: 34px; min-height: 30px; padding: 2px 6px; background: var(--bg); border: 1px solid var(--border); }
.gridwrap .cell:hover { background: var(--selection); }
.menuitem.filemenu { position: relative; cursor: pointer; }
.menuitem.filemenu input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.cwstatus .statusleft { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cwstatus .progress { display: inline-block; width: 110px; height: 6px; margin: 4px 10px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 30%, var(--border) 30%); background-size: 200% 100%; animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: 0 0; } to { background-position: -200% 0; } }

.dlg { height: auto !important; max-height: 92vh; }
.dlgbody { padding: 10px 14px; overflow: auto; display: grid; gap: 8px; }
.dlglabel { display: grid; gap: 3px; }
.dlgsearch { margin: 8px 14px 0; }
.msgtext { white-space: pre-wrap; }
.sourcebox { width: 100%; min-height: 260px; font-family: Consolas, monospace; font-size: 12px; }
.sourcebox.mono { min-height: 0; }
.helptext { white-space: pre-wrap; font-family: inherit; margin: 0; }
.dlgpreview { border: 1px solid var(--border); border-radius: 4px; padding: 8px; margin: 0; }
.objgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.objform { display: grid; gap: 8px; align-content: start; }
.objpreview { border: 1px solid var(--border); border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 6px; }
.objpreview img { max-width: 100%; max-height: 360px; }
.stylelist { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.stylelist button { text-align: left; }
.stylelist button.on { background: var(--selection); border-color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.checklist { display: grid; gap: 2px; max-height: 120px; overflow: auto; }
.slotlist { border: 1px solid var(--border); border-radius: 4px; min-height: 160px; max-height: 320px; overflow: auto; padding: 4px; }
.slotrow { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; border-bottom: 1px solid var(--border); }
.booklist.tall { max-height: 40vh; }
.bookrow.pick { cursor: pointer; }
.bookrow.pick.selected { background: var(--selection); }
.pollsel { width: 100%; }
@media (max-width: 900px) { .objgrid { grid-template-columns: 1fr; } }

/* Terminfenster */
.compose.appt { display: flex; flex-direction: column; }
.apptbody { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 12px 10px; overflow: auto; }
.apptform { flex: none; }
.apptform .frow > label:first-child { width: 96px; }
.apptform .frow > label.inl { width: auto; margin-left: 8px; }
.apptform .frow.wrap { flex-wrap: wrap; }
.apptform .frow .check { display: inline-flex; align-items: center; gap: 4px; width: auto; flex: none; }
.apptform .frow input[type=checkbox] { width: auto; flex: none; }
.apptform .frow input[type=date], .apptform .frow input[type=time] { flex: none; width: auto; min-width: 130px; }
.apptform .frow > select { flex: none; width: auto; min-width: 140px; }
.apptform .frow > select.onlinesel { min-width: 200px; }
.apptform .cats { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.catchip { color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.catdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.apptnotes { flex: 1; min-height: 140px; margin-top: 8px; width: 100%; resize: none; border: 1px solid var(--border); border-radius: 4px; padding: 8px; font: inherit; }

.typegrid { width: 100%; border-collapse: collapse; }
.typegrid th { text-align: left; font-weight: 600; font-size: 12px; padding: 4px; color: var(--muted); }
.typegrid td { padding: 2px 4px; }
.typegrid input { width: 100%; box-sizing: border-box; }
.typegrid input.num { width: 90px; }

.tplbody { display: grid; grid-template-columns: 240px 1fr; gap: 12px; min-height: 420px; }
.tpllist { border: 1px solid var(--border); border-radius: 4px; padding: 4px; overflow: auto; max-height: 520px; }
.tplitem { padding: 4px 8px; cursor: pointer; border-radius: 3px; }
.tplitem:hover { background: var(--hover, #eef2f3); }
.tplitem.sel { background: var(--accent-bg); font-weight: 600; }
.tpledit { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tplframe { flex: 1; min-height: 260px; width: 100%; border: 1px solid var(--border); border-radius: 4px; background: #fff; box-sizing: border-box; font-family: monospace; }
