/* The application: designed for phones first. */
:root { --ink: #23281f; --muted: #667062; --line: #d9d3c6; --paper: #f6f2ea; --card: #fff; --accent: #c9591d; --accent-dark: #a84712; --night: #1d211e; --bad: #b3261e; --good: #2f7d4f; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
ls-panel { display: block; }
[hidden] { display: none !important; }
h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
h3 { margin: 0 0 8px; font-size: 1.05rem; }

/* controls */
button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
button.primary { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-dark); }
button.danger { border-color: var(--bad); color: var(--bad); }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; box-sizing: border-box; background: #fff; color: var(--ink); font: inherit; }
input[type=checkbox] { width: 20px; min-height: 20px; margin: 0; }
textarea { min-height: 96px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; font-size: .9rem; font-weight: 600; }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-grid { display: grid; gap: 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.msg { margin: 8px 0 0; color: var(--bad); }
.msg:empty { display: none; }
.msg.ok { color: var(--good); }

/* the application's frame */
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--night); color: #f5efe4; }
.app-bar .brand { color: inherit; font-weight: 700; text-decoration: none; }
.app-bar .who { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.app-bar button { min-height: 34px; padding: 4px 10px; border-color: #59615a; background: transparent; color: inherit; }
.tabs { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; background: #2e352f; }
.tabs button { flex: 0 0 auto; border: none; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #d6cfc1; }
.tabs button:hover:not(:disabled) { color: #fff; }
.tabs button.active { border-bottom-color: var(--accent); color: #fff; font-weight: 600; }
.work { max-width: 1000px; margin: 0 auto; padding: 14px; }
.card { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.empty { padding: 24px 8px; color: var(--muted); text-align: center; }

/* sign-in */
.signin { max-width: 380px; margin: 8vh auto 0; }
.signin .back { margin: 14px 0 0; font-size: .9rem; }
.signin a { color: var(--accent-dark); }

/* the calendar */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 150px; text-align: center; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month-grid .dow { padding: 4px 2px; background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; text-align: center; }
.day { min-width: 0; min-height: 64px; padding: 2px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); box-sizing: border-box; font-size: .75rem; }
.day.other { background: #faf8f3; color: #a8a99f; }
.day.today .num { display: inline-block; min-width: 1.5em; border-radius: 10px; background: var(--accent); color: #fff; text-align: center; }
.chip { display: block; width: 100%; min-height: 0; margin-top: 2px; padding: 1px 3px; overflow: hidden; border: none; border-radius: 3px; background: #e4d6bd; font-size: .7rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.chip.cancelled { background: #eee; color: var(--muted); text-decoration: line-through; }
.trip-row { display: block; width: 100%; height: auto; margin-bottom: 8px; padding: 10px 12px; text-align: left; }
.trip-row .when { color: var(--muted); font-size: .85rem; }
.trip-row .title { display: block; font-weight: 600; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e4d6bd; font-size: .78rem; }
.badge.cancelled { background: #f5d9d6; color: var(--bad); }
.details { margin: 10px 0 0; }
.details dt { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* members */
.member-row { display: flex; width: 100%; height: auto; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding: 10px 12px; text-align: left; }
.member-row .sub { display: block; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.member-row.inactive { opacity: .6; }
.password-row { display: flex; gap: 8px; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }

@media (min-width: 720px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .wide { grid-column: 1 / -1; }
    .day { min-height: 92px; padding: 4px; font-size: .85rem; }
    .chip { padding: 2px 5px; font-size: .78rem; }
}
