/* Bautagebuch24 app additions: forms, change log, closed report, addenda. Needs ci/tokens.css and stil.css first. Mobile first, desktop from 900px. */

/* page frame: on the phone the action bar sits at the bottom of the screen */
.workspace { min-height: 100vh; display: flex; flex-direction: column; }
.workspace > .app-main { flex: 1 0 auto; align-content: start; }
.actionbar-even { grid-template-columns: 1fr 1fr; }
.actionbar-even .btn { padding: 0 12px; font-size: 16px; }

/* forms */
.form-wrap { width: 100%; max-width: 720px; }
.form { display: grid; gap: 18px; padding: 18px 16px 20px; }
.form .card-head { margin-bottom: 0; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 15px; font-weight: 700; color: var(--b24-ink); }
.field-label small { font-size: 14px; font-weight: 500; color: var(--b24-muted); margin-left: 6px; }
.field-hint { font-size: 14px; color: var(--b24-muted); }
.field-row { display: grid; gap: 18px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.input { display: block; width: 100%; min-height: 52px; padding: 0 14px; font: inherit; font-size: 17px; color: var(--b24-ink); background: var(--b24-white); border: 2px solid var(--b24-line); border-radius: var(--b24-radius-small); }
.input:focus { outline: none; border-color: var(--b24-signal); box-shadow: 0 0 0 3px var(--b24-signal-soft); }
.input-unit { position: relative; max-width: 200px; }
.input-unit .input { padding-right: 56px; font-weight: 700; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--b24-muted); }
.form-actions { justify-content: flex-end; gap: 12px; padding-top: 20px; border-top: 1px solid var(--b24-line); }

/* quick pick of recent names */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; background: var(--b24-white); border: 2px solid var(--b24-line); border-radius: 999px; font-size: 16px; font-weight: 600; cursor: pointer; }
.chip svg { width: 18px; height: 18px; color: var(--b24-action); }

/* calm notice with icon */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--b24-white); border: 1px solid var(--b24-line); border-radius: var(--b24-radius); font-size: 16px; color: var(--b24-muted); }
.notice svg { width: 22px; height: 22px; flex: none; color: var(--b24-ink); }
.notice b { display: block; color: var(--b24-ink); font-size: 17px; }
.form .notice { background: var(--b24-concrete); border-color: var(--b24-concrete); }

/* change log: stacked cards on the phone, table on the desktop */
.log { display: grid; gap: 10px; }
.log-head { display: none; }
.log-item { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 2px 12px; background: var(--b24-white); border: 1px solid var(--b24-line); border-radius: var(--b24-radius); padding: 14px 16px; }
.log-time { grid-row: 1 / span 3; font-family: var(--b24-font-display); font-weight: 700; font-size: 28px; line-height: 1; }
.log-who, .log-what, .log-change, .log-note { grid-column: 2; }
.log-who { font-weight: 700; }
.log-auto { color: var(--b24-muted); font-weight: 600; }
.log-what { font-size: 15px; color: var(--b24-muted); }
.log-change, .log-note { display: flex; align-items: center; gap: 4px 8px; margin-top: 6px; }
.log-change { flex-wrap: wrap; }
.log-change del { color: var(--b24-muted); text-decoration: line-through; }
.log-change ins { text-decoration: none; font-weight: 700; }
.log-note { font-size: 15px; color: var(--b24-muted); gap: 10px; }
.log-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: var(--b24-radius-small); flex: none; }
.log-tag { display: inline-flex; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--b24-concrete); color: var(--b24-muted); padding: 2px 9px; border-radius: 999px; }
.arrow { width: 18px; height: 18px; flex: none; color: var(--b24-muted); }

/* addenda of a closed report */
.addenda li { padding: 2px 0 12px; }
.addendum-meta { font-size: 14px; font-weight: 700; color: var(--b24-muted); }

/* app only: what the SOLL images show as still pictures */
.actionbar { position: sticky; bottom: 0; z-index: 2; }
.rows a.entry { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: 1; min-height: 48px; color: inherit; }
.card-alert a.entry { color: inherit; }
.weather a { display: block; color: inherit; }
.site { position: relative; }
.site h2 a { color: inherit; }
.site h2 a::after { content: ""; position: absolute; inset: 0; }
.rows li.pending { opacity: .75; }
.camera { cursor: pointer; }
.camera-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
textarea.input { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.4; }
.form-error { font-size: 16px; font-weight: 700; color: var(--b24-signal-ink); background: var(--b24-signal-soft); padding: 10px 14px; border-radius: var(--b24-radius-small); }
.form .add { border-top: 0; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; justify-self: start; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

@media (min-width: 900px) {
  .workspace { display: grid; min-height: 0; }
  .toolbar { min-height: 77px; }
  .form { gap: 22px; padding: 28px 32px; }
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .log { gap: 0; background: var(--b24-white); border: 1px solid var(--b24-line); border-radius: var(--b24-radius); overflow: hidden; }
  .log-head, .log-item { display: grid; grid-template-columns: 84px 170px minmax(0, 1fr) 120px 20px minmax(0, 1.5fr); gap: 0 20px; align-items: center; padding: 16px 24px; }
  .log-head { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--b24-muted); background: var(--b24-concrete); padding-top: 12px; padding-bottom: 12px; }
  .log-item { border: 0; border-top: 1px solid var(--b24-line); border-radius: 0; }
  .log-time { grid-row: auto; font-size: 26px; }
  .log-item .log-who { grid-column: 2; }
  .log-item .log-what { grid-column: 3; font-size: 16px; color: var(--b24-ink); }
  .log-item .log-change { display: contents; }
  .log-change del, .log-change .log-tag { grid-column: 4; justify-self: start; }
  .log-change .arrow { grid-column: 5; }
  .log-change ins { grid-column: 6; }
  .log-item .log-note { grid-column: 4 / -1; margin-top: 0; }
}
