:root {
  color-scheme: light;
  --bg: #f3f8f8;
  --panel: #ffffff;
  --panel-soft: #edf7f6;
  --soft: #f7fbfb;
  --text: #102f3a;
  --muted: #617985;
  --border: #d6e7ea;
  --primary: #0b6f8f;
  --primary-dark: #083d56;
  --accent: #17a2a6;
  --sun: #f4b761;
  --sand: #f7efe0;
  --coral: #e96f5f;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(10, 58, 76, 0.12);
  --shadow-soft: 0 10px 24px rgba(10, 58, 76, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--theme-canvas, radial-gradient(circle at 12% 0%, rgba(244, 183, 97, 0.16), transparent 26rem),
    radial-gradient(circle at 92% 6%, rgba(23, 162, 166, 0.14), transparent 30rem),
    linear-gradient(180deg, #fbfefe 0%, var(--bg) 44%, #edf6f7 100%));
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

select[multiple] {
  min-height: 8.8rem;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  color: var(--text);
  padding: 0.8rem 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--theme-shadow, 0 0 0 3px rgba(10, 120, 153, 0.14));
  outline: none;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-badge {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-signature {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: lowercase;
}

.brand-mark {
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(8, 61, 86, 0.18));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-name {
  transform: translateY(-0.02em);
}

.topbar h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.01em;
}

.login-panel,
.workspace {
  display: grid;
  gap: 1rem;
}

body.is-authenticated .login-panel {
  display: none !important;
}

body.is-authenticated .workspace {
  display: grid !important;
}

.panel-form,
.request-form,
.list-panel {
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-form {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.panel-form p,
.request-form p,
.list-header p {
  color: var(--muted);
}

.toolbar,
.status-strip {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar {
  background:
    var(--theme-surface, linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 251, 250, 0.98)));
  border: 1px solid var(--border);
  border-radius: 8px;
  order: 1;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.select-label {
  min-width: min(420px, 100%);
}

.toolbar-actions,
.form-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.status-strip {
  align-items: center;
  background: var(--theme-raised, rgba(231, 246, 245, 0.92));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  order: 2;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.module-nav {
  display: flex;
  gap: 0.55rem;
  order: 3;
  overflow-x: auto;
  padding: 0.15rem 0 0.25rem;
  scrollbar-width: none;
}

.module-nav::-webkit-scrollbar {
  display: none;
}

.module-tab {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--border);
  background: var(--theme-surface, rgba(255, 255, 255, 0.95));
  color: var(--primary-dark);
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.module-tab.is-active {
  border-color: var(--primary);
  background: var(--theme-tint, linear-gradient(135deg, var(--primary), #0f8fa3));
  color: var(--theme-ink, #fff);
}

.home-panel {
  display: grid;
  gap: 1rem;
  order: 4;
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.home-header p {
  color: var(--muted);
}

.home-cruise-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.22));
  background:
    var(--theme-surface, linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(233, 247, 248, 0.94)));
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.home-cruise-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.home-cruise-card-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-cruise-card-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
}

.home-cruise-map-status {
  border: 1px solid var(--border);
  background: var(--theme-raised, rgba(237, 247, 248, 0.92));
  color: var(--primary-dark);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.home-cruise-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.home-cruise-details div {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--border);
  background: var(--theme-surface, rgba(255, 255, 255, 0.86));
  padding: 0.75rem;
}

.home-cruise-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-cruise-details dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.home-cruise-position dd {
  display: grid;
  gap: 0.55rem;
}

.home-cruise-position button {
  justify-self: start;
}

.home-cruise-map {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  min-height: 260px;
}

.home-cruise-map iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

.home-cruise-map-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  margin: 0;
  padding: 0.85rem;
  text-align: center;
}

.home-welcome-panel,
.home-crew-panel,
.home-notification-panel {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  background: var(--theme-surface, linear-gradient(180deg, #ffffff 0%, var(--soft) 100%));
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.home-welcome-panel span,
.home-section-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-welcome-panel h3,
.home-section-header h3 {
  margin: 0.2rem 0 0;
}

.home-welcome-panel p {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}

.home-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.home-section-header small {
  max-width: 28rem;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.home-crew-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.home-crew-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  border: 1px solid var(--border);
  background: var(--theme-surface, rgba(255, 255, 255, 0.88));
  padding: 0.75rem;
}

.crew-avatar,
.home-crew-initials {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 999px;
  background: var(--theme-raised, linear-gradient(135deg, var(--primary), #0f8fa3));
  color: var(--theme-ink, #fff);
  font-weight: 900;
  overflow: hidden;
}

.crew-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crew-avatar.small {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.crew-profile-photo-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, rgba(250, 253, 253, 0.95));
  color: var(--muted);
  font-weight: 800;
  padding: 0.8rem;
}

.crew-profile-photo-preview img {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  object-fit: cover;
}

.crew-profile-photo-preview div {
  display: grid;
  gap: 0.2rem;
}

.crew-profile-photo-preview strong {
  color: var(--text);
  font-weight: 900;
}

.crew-profile-photo-preview small {
  color: var(--muted);
  font-weight: 800;
}

.home-crew-body,
.home-crew-item div {
  min-width: 0;
}

.home-crew-item strong,
.home-crew-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-crew-item strong {
  color: var(--text);
}

.home-crew-item small,
.home-crew-empty {
  color: var(--muted);
  font-weight: 800;
}

.home-crew-skills {
  margin-top: 0.2rem;
  color: var(--primary-dark) !important;
}

.home-crew-empty {
  margin: 0;
}

.home-crew-documents {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.home-crew-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.home-crew-document-actions .ghost-button {
  padding: 0.45rem 0.65rem;
}

.home-crew-document-actions span {
  align-self: center;
  color: var(--muted);
  font-weight: 900;
}

.home-notification-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.home-notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.crew-panel {
  display: grid;
  gap: 1rem;
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.crew-header,
.crew-profile-form,
.crew-invite-form,
.crew-document-note {
  display: grid;
  gap: 0.85rem;
}

.crew-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.crew-header-actions,
.crew-profile-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.crew-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crew-header p,
.crew-profile-form p,
.crew-invite-form p,
.crew-document-note p {
  color: var(--muted);
  margin: 0;
  font-weight: 800;
}

.crew-profile-form,
.crew-invite-form,
.crew-document-note {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 1rem;
}

.crew-profile-form {
  width: min(100%, 980px);
  justify-self: center;
}

.crew-profile-form label,
.crew-profile-form input,
.crew-profile-form select,
.crew-profile-form textarea {
  min-width: 0;
}

.crew-profile-form input,
.crew-profile-form select,
.crew-profile-form textarea {
  padding: 0.7rem 0.8rem;
}

.crew-profile-form fieldset {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--theme-surface, rgba(255, 255, 255, 0.9));
}

.crew-profile-form legend {
  color: var(--primary-dark);
  font-weight: 900;
  padding: 0 0.35rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.checkbox-grid label {
  align-items: center;
  background: var(--theme-surface, rgba(250, 253, 253, 0.95));
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  gap: 0.45rem;
  padding: 0.65rem;
}

.checkbox-grid input {
  width: auto;
}

.crew-list {
  display: grid;
  gap: 0.85rem;
}

.crew-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.crew-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.crew-card-identity,
.communication-author,
.chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.crew-card h3,
.crew-card p {
  margin: 0;
}

.crew-card p {
  color: var(--muted);
  font-weight: 800;
}

.crew-profile-status {
  border: 1px solid var(--theme-line, rgba(218, 132, 39, 0.45));
  border-radius: 999px;
  color: var(--theme-ink, #9b5c17);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

.crew-profile-status[data-status="complete"] {
  border-color: var(--theme-line, rgba(31, 128, 88, 0.45));
  color: var(--theme-ink, #1f8058);
}

.crew-profile-status[data-status="warning"] {
  border-color: var(--sp-warning-line, rgba(204, 143, 32, 0.5));
  color: var(--sp-warning-ink, #9b5c17);
}

.crew-card-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.crew-card-details div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, rgba(250, 253, 253, 0.95));
  padding: 0.65rem;
}

.crew-card-details dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-card-details dd {
  margin: 0.2rem 0 0;
  color: var(--text);
  font-weight: 800;
}

.crew-document-list {
  display: grid;
  gap: 0.6rem;
}

.crew-document-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, rgba(250, 253, 253, 0.95));
  padding: 0.7rem;
}

.crew-document-item div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.crew-document-item strong,
.crew-document-item small {
  overflow-wrap: anywhere;
}

.crew-document-item small {
  color: var(--muted);
  font-weight: 800;
}

.crew-document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.module-card {
  display: grid;
  gap: 0.45rem;
  min-height: 150px;
  align-content: start;
  border: 1px solid var(--border);
  background:
    var(--theme-surface, linear-gradient(180deg, #ffffff 0%, #f8fdfd 100%));
  color: var(--text);
  padding: 1rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.module-card span {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-card strong {
  font-size: 1.35rem;
  line-height: 1.15;
}

.module-card small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.home-duty-panel {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--border);
  background: var(--theme-surface, linear-gradient(180deg, #ffffff 0%, var(--soft) 100%));
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.home-duty-panel h3 {
  margin: 0;
}

.home-duty-panel p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.home-duty-list {
  display: grid;
  gap: 0.6rem;
}

.home-duty-item {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  text-align: left;
}

.home-duty-item strong {
  color: var(--primary-dark);
}

.home-duty-item span,
.home-duty-more {
  color: var(--muted);
  font-weight: 700;
}

.home-duty-item .home-duty-allergies {
  margin-top: 0.25rem;
}

.home-duty-item .home-duty-allergies.declared {
  color: var(--theme-ink, #b42318);
}

.home-duty-item .home-duty-allergies.none {
  color: var(--theme-ink, #176b39);
}

.request-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 1rem;
  order: 4;
}

.request-form,
.list-panel,
.chat-panel,
.communication-panel,
.menu-panel {
  padding: 1rem;
}

.request-form {
  align-self: start;
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.list-panel {
  min-width: 0;
}

.list-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.request-list {
  display: grid;
  gap: 0.8rem;
}

.request-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--theme-surface, #fff);
  box-shadow: var(--shadow-soft);
}

.request-main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.request-main h3 {
  overflow-wrap: anywhere;
}

.request-meta,
.request-notes {
  color: var(--muted);
}

.request-notes {
  margin-top: 0.55rem;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  background: var(--panel-soft);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.sent {
  background: var(--theme-raised, #e8f7ef);
  color: var(--theme-ink, #147a45);
}

.status-pill.done {
  background: var(--theme-raised, #eef2ff);
  color: var(--theme-ink, #3446a1);
}

.card-actions {
  margin-top: 0.85rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0.7rem 1rem;
}

.primary-button {
  background: var(--theme-raised, linear-gradient(135deg, var(--primary), #0e8ca0));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 8px 18px rgba(10, 120, 153, 0.18));
}

.primary-button:hover {
  background: var(--theme-emphasis, var(--primary-dark));
}

.secondary-button {
  background: var(--theme-raised, linear-gradient(135deg, var(--accent), #0c8d86));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 8px 18px rgba(16, 155, 145, 0.16));
}

.ghost-button {
  background: var(--theme-raised, #edf7f8);
  color: var(--primary-dark);
}

.ghost-button.danger-button {
  background: var(--sp-error-bg, #fff1ef);
  color: var(--danger);
}

.link-button {
  min-height: auto;
  background: var(--theme-raised, #edf7f8);
  color: var(--primary-dark);
  padding: 0.35rem 0.7rem;
  text-align: center;
}

.danger-link {
  background: transparent;
  color: var(--danger);
  padding-inline: 0;
}

.form-help {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

body.has-modal {
  overflow: hidden;
}

body.has-modal::before {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--theme-emphasis, rgba(23, 49, 60, 0.38));
  content: "";
}

.menu-edit-modal {
  position: fixed;
  top: 52%;
  left: 50%;
  z-index: 220;
  width: min(92vw, 640px);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.menu-edit-modal h3 {
  margin: 0;
}

.menu-edit-modal .menu-dialog-allergies {
  padding: .65rem .75rem;
}

.menu-edit-modal .menu-dialog-allergies strong {
  display: block;
  margin-bottom: .25rem;
}

.menu-edit-modal .menu-dialog-allergies p {
  margin: .2rem 0;
}

.menu-edit-modal .form-actions {
  position: sticky;
  bottom: 0;
  background: var(--theme-surface, linear-gradient(180deg, rgba(255,255,255,0), var(--panel) 18%));
  margin: .2rem -.1rem -.1rem;
  padding-top: .55rem;
}

.form-message {
  min-height: 1.4rem;
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

.chat-panel,
.communication-panel,
.menu-panel,
.purchase-panel {
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.menu-panel {
  order: 3;
}

.purchase-panel {
  order: 5;
  width: 100%;
  margin-inline: 0;
}

.chat-panel {
  order: 6;
}

.communication-panel {
  order: 7;
}

.chat-header,
.communication-header,
.purchase-header,
.chat-form,
.communication-form {
  display: grid;
  gap: 0.85rem;
}

.stopover-shopping-form {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.22));
  border-radius: 8px;
  background:
    var(--theme-surface, linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(233, 247, 248, 0.94)));
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  max-width: 760px;
}

.stopover-shopping-form p {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.stopover-shopping-heading {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
}

.stopover-shopping-heading h3 {
  font-size: 1.25rem;
}

.stopover-shopping-heading .secondary-button {
  white-space: nowrap;
}

.stopover-shopping-form.is-waiting label,
.stopover-shopping-form.is-waiting textarea,
.stopover-shopping-form.is-waiting input,
.stopover-shopping-form.is-waiting select {
  opacity: 0.72;
}

.stopover-store-links {
  display: grid;
  gap: 0.5rem;
  border-radius: 8px;
  background: var(--theme-surface, rgba(255, 255, 255, 0.72));
  padding: 0.75rem;
}

.stopover-store-links p {
  margin: 0;
  font-size: 0.9rem;
}

.stopover-store-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stopover-store-link-list a {
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.24));
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

.purchase-store-finder {
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.18));
  border-radius: 8px;
  background: var(--theme-raised, rgba(233, 247, 248, 0.66));
  padding: 0.75rem;
}

.purchase-store-finder p {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

.purchase-store-results {
  display: grid;
  gap: 0.5rem;
}

.chat-header,
.communication-header,
.purchase-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.purchase-header h2 {
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1.05;
}

.purchase-header .secondary-button {
  align-self: start;
  padding-inline: 0.9rem;
}

.purchase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: end;
}

.chat-header p,
.communication-header p,
.purchase-header p {
  color: var(--muted);
}

.communication-form {
  border: 1px solid var(--border);
  background: var(--soft);
  padding: 1rem;
}

.communication-list {
  display: grid;
  gap: 0.85rem;
}

.communication-item {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--border);
  background: var(--theme-surface, #fff);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.communication-item[data-importance="Important"] {
  border-color: var(--theme-line, rgba(218, 132, 39, 0.55));
}

.communication-item[data-importance="Urgent"] {
  border-color: var(--sp-critical-line, rgba(181, 58, 45, 0.65));
}

.communication-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.communication-item h3,
.communication-item p {
  margin: 0;
}

.communication-item-header p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 800;
}

.communication-body {
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-wrap;
}

.communication-importance {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--primary-dark);
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.purchase-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 0.85rem;
}

.purchase-list-panel {
  display: grid;
  align-self: start;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
}

.purchase-list-panel p {
  color: var(--muted);
}

.purchase-assignments {
  display: grid;
  gap: 0.65rem;
}

.purchase-assignment-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  background: var(--theme-surface, #fff);
  box-shadow: var(--shadow-soft);
}

.purchase-assignment-card h4 {
  margin: 0 0 0.35rem;
}

/* Indication du responsable et demarrage visible avant les articles. */
.purchase-mission-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-top: .85rem;
  padding: .8rem 1rem;
  border: 1px solid var(--theme-line, #d5e7eb);
  border-radius: 10px;
  background: var(--theme-surface, #f1f8fa);
}
.purchase-mission-banner.is-other-mission {
  background: var(--theme-raised, #f1f4f6);
  border-color: var(--theme-line, #dbe4e9);
}
.purchase-mission-banner.is-startable {
  background: var(--theme-raised, #e9f4f8);
  border-color: var(--theme-line, #bedce8);
}
.purchase-mission-banner.is-in-progress {
  background: var(--theme-raised, #ecf8ef);
  border-color: var(--theme-line, #bee0c8);
}
.purchase-mission-banner strong { color: var(--theme-ink, #163e50); }
.purchase-mission-banner span { color: var(--theme-ink, #546d79); font-size: .9rem; }
.purchase-mission-banner .primary-button { max-width: 100%; white-space: normal; }

.purchase-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, linear-gradient(135deg, var(--panel-soft), #f8fdfd));
  padding: 0.85rem;
}

.purchase-summary h4 {
  margin: 0 0 0.35rem;
}

.purchase-progress {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
  margin-top: 0.7rem;
}

.purchase-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--theme-emphasis, linear-gradient(90deg, var(--primary-dark), #0b6f8f));
}

.purchase-items {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.purchase-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}

.purchase-item-row span {
  color: var(--muted);
  font-weight: 700;
}

/* Validation des achats directement sur la ligne de mission (tactile et clavier). */
.purchase-item-row {
  display: block;
  border-top: 1px solid var(--border);
}
.purchase-item-control {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}
button.purchase-item-control.is-actionable {
  cursor: pointer;
  background: var(--theme-surface, #f1f8fc);
  border-color: var(--theme-line, #d4e8f1);
}
button.purchase-item-control.is-actionable:focus-visible {
  outline: 3px solid var(--sp-focus, #0f6b8f);
  outline-offset: 2px;
}
button.purchase-item-control.is-actionable:hover { background: var(--theme-tint, #e5f2f8); }
button.purchase-item-control.is-actionable:disabled { opacity: .6; cursor: wait; }
.purchase-item-check {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--theme-line, #95afbc);
  border-radius: 7px;
  font-size: 18px;
  font-weight: 800;
}
.purchase-item-details { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.purchase-item-details strong { overflow-wrap: anywhere; }
.purchase-item-subtext { font-size: .86rem; color: var(--theme-ink, #526976); }
.purchase-item-action { font-size: .79rem; font-weight: 750; color: var(--theme-ink, #0f6b8f); text-align: right; max-width: 9rem; }
.purchase-item-row.is-purchased .purchase-item-control { background: var(--theme-raised, #e7f6ea); border-color: var(--theme-line, #b9ddc4); }
.purchase-item-row.is-purchased .purchase-item-check { background: var(--theme-emphasis, #267a4c); border-color: var(--theme-line, #267a4c); color: var(--theme-ink, #fff); }
.purchase-item-row.is-purchased .purchase-item-action { color: var(--theme-ink, #267a4c); }
.purchase-item-row.is-processed .purchase-item-control { background: var(--theme-raised, #f4f5f5); }
@media (max-width: 640px) {
  .purchase-item-control { flex-wrap: wrap; }
  .purchase-item-action { max-width: none; width: 100%; text-align: left; padding-left: 2.6rem; }
}

.chat-actions {
  display: flex;
  gap: 0.65rem;
  align-items: end;
}

.chat-room-label {
  display: none;
}

.chat-actions select {
  min-width: 100%;
}

.chat-room-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.35rem 0 0.5rem;
}

.chat-room-tab {
  min-height: var(--sp-control-height, 44px);
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.14));
  border-radius: 10px;
  background: var(--theme-raised, rgba(238, 247, 248, 0.94));
  color: var(--primary-dark);
  box-shadow: none;
  padding: 0.65rem 1rem;
}

.chat-room-tab:hover {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.22));
  background: var(--theme-tint, rgba(247, 239, 224, 0.72));
}

.chat-room-tab.is-active {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.18));
}

.chat-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, linear-gradient(135deg, var(--panel-soft), #f8fdfd));
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-room-badge {
  color: var(--primary-dark);
  overflow-wrap: anywhere;
}

.chat-messages {
  display: grid;
  gap: 0.75rem;
  max-height: min(520px, 50vh);
  overflow: auto;
  padding: 0.25rem;
  scroll-behavior: smooth;
}

.chat-message {
  width: min(680px, 92%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  padding: 0.75rem;
  box-shadow: var(--shadow-soft);
}

.chat-message.mine {
  justify-self: end;
  background: var(--panel-soft);
}

.chat-panel[data-room-type="SkipperTeam"] .chat-status,
.chat-panel[data-room-type="SkipperTeam"] .chat-message.mine {
  background: var(--theme-raised, #eef2ff);
}

.chat-panel[data-room-type="SkipperNetwork"] .chat-status,
.chat-panel[data-room-type="SkipperNetwork"] .chat-message.mine {
  background: var(--theme-surface, #ecfdf3);
}

.chat-message-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0;
}

.chat-message-body {
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.attachment-button {
  min-height: var(--sp-control-height, 44px);
  border: 1px solid var(--border);
  background: var(--theme-surface, #fff);
  color: var(--primary-dark);
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  text-align: left;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 251, 250, 0.96)));
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.chat-form textarea {
  min-height: 3.25rem;
  background: var(--theme-surface, #fff);
  color: var(--text);
  font-size: 1rem;
  scroll-margin: 8rem 0;
  resize: vertical;
  line-height: 1.45;
}

.chat-input-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.chat-input-actions button {
  min-height: var(--sp-control-height, 44px);
}

.chat-input-actions .field-hint {
  justify-self: auto;
  margin-left: 0;
}

.chat-form .file-label {
  max-width: 520px;
}

.chat-form > button {
  justify-self: start;
  min-width: 140px;
}

.file-label input {
  padding: 0.65rem;
}

.field-hint {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.menu-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.menu-header p {
  color: var(--muted);
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: end;
}

.menu-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  margin: 1rem 0 1.15rem;
  padding: 0.65rem 0.75rem;
  font-weight: 800;
}

.menu-crew-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: -0.55rem 0 1.2rem;
}

.menu-crew-progress-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 850;
  padding: 0.45rem 0.65rem;
}

.menu-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
}

.menu-subnav button {
  min-height: var(--sp-control-height, 44px);
  border: 1px solid var(--border);
  background: var(--theme-surface, rgba(255, 255, 255, 0.95));
  color: var(--primary-dark);
  padding: 0.55rem 0.85rem;
  box-shadow: none;
}

.menu-subnav button.is-active {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
}

.menu-tab-panel {
  scroll-margin-top: 1rem;
}

.menu-allergy-panel {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--theme-line, rgba(180, 35, 24, 0.22));
  border-radius: 8px;
  background: var(--theme-surface, #fff7f5);
  color: var(--text);
  margin: 0 0 1.35rem;
  padding: 1rem;
}

.menu-allergy-panel h3,
.menu-allergy-panel p {
  margin: 0;
}

.menu-allergy-panel > p {
  color: var(--muted);
  font-weight: 800;
}

.menu-recipe-panel,
.menu-skipper-idea-panel {
  display: grid;
  gap: 1.05rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, linear-gradient(180deg, #fff 0%, var(--soft) 100%));
  color: var(--text);
  margin: 0 0 1.5rem;
  padding: 1rem;
}

.menu-panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  padding-bottom: 0.2rem;
}

.menu-panel-heading .primary-button {
  flex: 0 0 auto;
}

.menu-recipe-panel h3,
.menu-recipe-panel p,
.menu-skipper-idea-panel h3,
.menu-skipper-idea-panel p {
  margin: 0;
}

.menu-recipe-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.menu-recipe-filters button {
  min-height: var(--sp-control-height, 44px);
  border: 1px solid var(--border);
  background: var(--theme-surface, rgba(255, 255, 255, 0.92));
  color: var(--primary-dark);
  padding: 0.5rem 0.8rem;
  box-shadow: none;
}

.menu-recipe-filters button.is-active {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
}

.menu-recipe-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.menu-recipe-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  padding: 0.85rem;
}

.menu-recipe-card h4,
.menu-recipe-card p {
  margin: 0;
}

/* Suggestion deja retenue par un equipier dans cette croisiere. */
.menu-recipe-card.menu-recipe-already-used {
  border-color: var(--theme-line, #99d0ac);
  background: var(--theme-raised, #e8f6ec);
}

.menu-recipe-already-used-label {
  color: var(--theme-ink, #14633a);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.menu-recipe-card.menu-recipe-already-used .secondary-button:disabled {
  background: var(--sp-disabled-bg, #d5eadc);
  border-color: var(--sp-disabled-line, #a8d2b5);
  color: var(--sp-disabled-ink, #14633a);
  opacity: 1;
  cursor: not-allowed;
}

.menu-skipper-idea-form {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--theme-line, rgba(13, 111, 122, 0.24));
  border-radius: 8px;
  background: var(--theme-surface, rgba(238, 250, 250, 0.92));
  padding: 1rem;
}

.menu-skipper-idea-form h4,
.menu-skipper-idea-form p {
  margin: 0;
}

.menu-skipper-idea-form p {
  color: var(--muted);
  font-weight: 800;
}

.menu-recipe-type {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .menu-recipe-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .menu-panel-heading {
    flex-direction: column;
  }

  .menu-recipe-list {
    grid-template-columns: 1fr;
  }
}

.menu-allergy-list {
  display: grid;
  gap: 0.35rem;
}

.menu-allergy-list p {
  color: var(--danger);
  font-weight: 900;
}

.inline-form-button {
  align-self: end;
}

#menuStatusBadge {
  color: var(--primary-dark);
}

.menu-workbench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.mini-form {
  display: grid;
  align-self: start;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
}

.mini-form h3 {
  font-size: 1rem;
}

.menu-days {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.85rem;
}

.menu-day-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.menu-day-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.menu-day-header h3 {
  margin: 0;
}

.menu-meal {
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.menu-meal-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.menu-meal h4 {
  margin: 0;
}

.menu-requirements {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1040px) {
  .home-grid,
  .crew-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-cruise-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crew-card-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-crew-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding-inline: 0.75rem;
  }

  .topbar,
  .toolbar,
  .status-strip,
  .request-main {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .form-actions,
  .card-actions,
  .chat-actions,
  .purchase-actions,
  .chat-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .request-grid,
  .form-row,
  .home-grid,
  .crew-dashboard-grid,
  .home-cruise-details,
  .crew-card-details,
  .checkbox-grid,
  .home-crew-list,
  .chat-header,
  .communication-header,
  .crew-profile-form-header,
  .crew-header,
  .purchase-header,
  .purchase-grid {
    grid-template-columns: 1fr;
  }

  .crew-header-actions,
  .crew-profile-form-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-section-header {
    display: grid;
  }

  .home-section-header small {
    max-width: none;
    text-align: left;
  }

  .home-notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .module-nav {
    margin-inline: -0.75rem;
    padding-inline: 0.75rem;
  }

  .module-card {
    min-height: 120px;
  }

  .chat-actions select {
    min-width: 0;
  }

  .chat-room-label {
    min-width: 0;
  }

  .chat-status {
    align-items: stretch;
    flex-direction: column;
  }

  .communication-item-header {
    display: grid;
  }

  .menu-header,
  .menu-workbench {
    grid-template-columns: 1fr;
  }

  .menu-actions,
  .menu-status {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-day-header {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-meal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-item-row {
    grid-template-columns: 1fr;
  }

  .chat-message {
    width: 100%;
  }

  .panel-form {
    margin-top: 1rem;
  }
}


.boat-panel {
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 1rem;
}
.boat-panel[hidden], #boatModuleButton[hidden] { display: none !important; }
.boat-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.boat-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.boat-form, .boat-documents, .boat-document-list { display: grid; gap: 1rem; }
.boat-form fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; }
.boat-form legend { padding: 0 .4rem; font-weight: 600; }
.boat-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.boat-field-grid label { display: grid; gap: .4rem; min-width: 0; }
.boat-field-grid input, .boat-field-grid select { width: 100%; min-width: 0; }
.boat-form p, .boat-panel #boatHint { color: var(--muted); }
.boat-document { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding: .75rem; border: 1px solid var(--border); border-radius: 8px; }
.boat-document span { flex: 1 1 200px; overflow-wrap: anywhere; }
@media (max-width: 600px) { .boat-field-grid { grid-template-columns: 1fr; } .boat-header { flex-wrap: wrap; } .boat-header-actions { justify-content: flex-start; width: 100%; } }

.cash-panel { background: var(--theme-surface, var(--panel, #fff)); padding: 1.25rem; border-radius: 8px; display: grid; gap: 1.25rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.cash-panel[hidden], .cash-panel form[hidden] { display:none; }
.cash-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.15rem; }
.cash-wide { grid-column:1/-1; }
.cash-panel label { display:grid; gap:.4rem; margin:.5rem 0; }
.cash-header, .cash-section-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.cash-header h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem); line-height:1.05; }
.cash-overview { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.cash-overview article, .cash-card, .cash-section, .cash-payment-section, .cash-closure-section { border:1px solid var(--border); border-radius:8px; background:var(--theme-surface, linear-gradient(135deg, rgba(255,255,255,.98), rgba(242,251,250,.96))); padding:1.15rem; }
.cash-overview span { display:block; color:var(--muted); font-weight:800; margin-bottom:.25rem; }
.cash-overview strong { display:block; font-size:1.05rem; overflow-wrap:anywhere; }
.cash-settings-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr); gap:1rem; align-items:start; }
.cash-card { display:grid; gap:.9rem; }
.cash-actions { display:flex; flex-wrap:wrap; gap:.85rem; align-items:center; margin-top:.25rem; }
.cash-panel button { background:var(--theme-raised, linear-gradient(135deg, var(--accent), #0c8d86)); color:var(--theme-ink, #fff); box-shadow:var(--theme-shadow, 0 8px 18px rgba(16,155,145,.16)); padding:.68rem 1rem; min-height:42px; }
.cash-panel button:hover { background: var(--theme-emphasis, var(--primary-dark)); }
.cash-panel button:disabled { background:var(--sp-disabled-bg, #b8c5c9); color:var(--sp-disabled-ink, #17343d); box-shadow:none; }
.cash-panel details { border:1px solid var(--border); border-radius:8px; padding:.85rem; background:var(--theme-surface, rgba(255,255,255,.76)); }
.cash-panel details summary { cursor:pointer; font-weight:800; }
.cash-create-section { display:grid; gap:1.15rem; }
.cash-form fieldset { margin:.25rem 0 0; padding:1rem; border:1px solid var(--border); border-radius:8px; background:var(--theme-surface, rgba(255,255,255,.68)); }
.cash-form legend { padding:0 .35rem; font-weight:800; }
#cashAllMembers { margin:.35rem 0 .75rem; }
#cashParticipants { display:grid; gap:.55rem; }
#cashParticipants label { display:flex; align-items:center; gap:.7rem; margin:0; }
#cashParticipants input { width:auto; }
.cash-entry { border:1px solid var(--border); border-radius:8px; background:var(--theme-surface, #fff); padding:1.1rem; overflow-wrap:anywhere; box-shadow:var(--shadow-soft); }
.cash-entry-list { display:grid; gap:.9rem; }
.cash-entry p { margin:.4rem 0; }
.cash-entry button { margin:0; }
.cash-entry-actions, .cash-transfer-row { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; margin-top:1rem; padding-top:.85rem; border-top:1px solid var(--theme-line, #e2ecee); }
.cash-transfer-row { justify-content:space-between; }
.cash-transfer-row p { margin:0; }
.cash-receipt-actions { margin:.5rem 0 .25rem; padding-top:0; border-top:0; }
.cash-panel form { margin:0; }
@media(max-width:760px) { .cash-form, .cash-overview, .cash-settings-grid { grid-template-columns:1fr; } .cash-wide { grid-column:auto; } }

.cash-receipts { margin-top:1rem; border-top:1px dashed var(--theme-line, #ccd7da); padding-top:.5rem; }
.cash-receipt-dialog { width:min(92vw,800px); max-height:90vh; border:0; border-radius:16px; padding:1rem; }
.cash-receipt-dialog::backdrop { background:var(--theme-emphasis, rgba(0,0,0,.5)); }
#cashReceiptPreview img { max-width:100%; max-height:68vh; object-fit:contain; }
#cashReceiptPreview iframe { width:100%; height:65vh; border:0; }
.cash-receipts input[type=file] { max-width:100%; }

.cash-receipts .cash-file-picker { position:relative; display:inline-flex; align-items:center; min-height:48px; padding:.7rem 1rem; border:1px solid var(--theme-line, #557a85); border-radius:10px; background:var(--theme-raised, #edf5f5); color:var(--theme-ink, #173f49); cursor:pointer; overflow:hidden; }
.cash-receipts .cash-file-input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; z-index:1; }
.cash-file-picker:focus-within { outline:3px solid var(--sp-focus, #4795aa); outline-offset:3px; }
.cash-file-status { overflow-wrap:anywhere; }

.cash-ticket-preview { margin:1rem 0; padding:1rem; border:1px solid var(--theme-line, #ccd7da); border-radius:12px; background:var(--theme-surface, #fff); }
.cash-ticket-preview[hidden] { display:none; }
.cash-ticket-preview img { display:block; max-width:100%; height:auto; max-height:80vh; object-fit:contain; }
.cash-ticket-preview iframe { display:block; width:100%; height:70vh; border:0; }
.cash-ticket-preview a { display:inline-block; margin:.75rem 1rem .75rem 0; }

.cash-ocr-review { margin:1rem 0; padding:1rem; border:1px solid var(--theme-line, #4795aa); border-radius:12px; background:var(--theme-surface, #f3faf9); }
.cash-ocr-review[hidden] { display:none; }
.cash-ocr-review pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:16rem; overflow:auto; }
.cash-ocr-review .cash-ocr-confirm { display:flex; align-items:center; gap:.6rem; }
.cash-ocr-review input[type=checkbox] { width:auto; }

.cash-from-ticket { display:grid; gap:.85rem; padding:1.1rem; margin:1rem 0; border:1px solid var(--theme-line, #ccd7da); border-radius:12px; background:var(--theme-surface, #f3faf9); }
.cash-from-ticket[hidden] { display:none; }
.cash-from-ticket .cash-file-picker { position:relative; display:inline-flex; width:fit-content; min-height:48px; padding:.7rem 1rem; border:1px solid var(--theme-line, #557a85); border-radius:10px; background:var(--theme-raised, #edf5f5); cursor:pointer; overflow:hidden; }
.cash-from-ticket .cash-file-input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }

.cash-payment-section, .cash-closure-section { margin-top:0; }
.cash-payment-pending { border-left:4px solid var(--sp-pending-line, #bc861f); }
.cash-payment-confirmed { border-left:4px solid var(--sp-success-line, #368577); }
.cash-payment-cancelled { opacity:.7; }

/* Operational skipper home and cruise creation, v109. */
.home-priorities { padding: 1rem; border: 1px solid var(--border, #cbd5e1); border-radius: 1rem; margin-bottom: 1rem; }
.home-priorities h3 { margin: 0 0 .8rem; }
.home-priority-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.home-grid { margin-top: 0; margin-bottom: 1.3rem; }
details.home-cruise-card > summary, details.home-notification-panel > summary { cursor: pointer; font-weight: 700; padding: .7rem 0; }
.new-cruise-dialog { width: min(760px, calc(100vw - 2rem)); max-height: 90vh; overflow: auto; border: 0; border-radius: 1rem; padding: 1.5rem; }
.new-cruise-dialog::backdrop { background: var(--theme-emphasis, rgb(15 23 42 / .5)); }
.new-cruise-form, .new-cruise-form fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.new-cruise-form label { display: flex; flex-direction: column; gap: .35rem; }
.new-cruise-form .wide, .new-cruise-form fieldset p { grid-column: 1 / -1; }
.new-cruise-form fieldset { border: 1px solid var(--theme-line, #cbd5e1); border-radius: .6rem; padding: 1rem; min-width: 0; }
.new-cruise-form input { width: 100%; min-width: 0; box-sizing: border-box; }
@media(max-width: 560px) { .new-cruise-form, .new-cruise-form fieldset { grid-template-columns: 1fr; } }

.skipper-cruise-home { margin-bottom: 1.5rem; }
.skipper-cruise-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 1rem; }
.archive-cruise-card { padding: 1rem; border-bottom: 1px solid var(--theme-line, #cbd5e1); }

/* v112: consistent navigation order for every module. */
.workspace > * { order: 0; }
.workspace > .module-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  align-self: start;
  align-items: center;
  flex-wrap: wrap;
  padding: calc(.65rem + env(safe-area-inset-top, 0px)) .65rem .65rem;
  background: var(--theme-surface, #eef8fb);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}
.return-to-menu { display: none; }
body.is-authenticated .return-to-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 50;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  padding: .7rem 1rem;
  color: var(--theme-ink, white);
  background: var(--theme-emphasis, var(--primary-dark));
  box-shadow: var(--shadow);
}
body.is-authenticated { padding-bottom: 5rem; }
@media (max-width: 760px) {
  .workspace > .module-nav { flex-wrap: nowrap; overflow-x: auto; }
}

/* v113: connected identity and crew read-only detail sheets. */
.session-badge { display: inline-flex; align-items: center; gap: .65rem; }
.session-avatar { width: 44px; height: 44px; flex: 0 0 44px; object-fit: cover; border-radius: 50%; }
.session-identity-text { display: grid; text-align: left; }
.session-identity-text small { color: var(--muted); }
.crew-contact-link { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.crew-detail-actions { margin: 1rem 0; }
.crew-details-dialog { width: min(760px, calc(100vw - 2rem)); max-height: 90vh; overflow: auto; border: 0; border-radius: 1rem; padding: 1.5rem; color: var(--text); }
.crew-details-dialog::backdrop { background: var(--theme-emphasis, rgb(15 23 42 / .5)); }
.crew-medical-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.crew-medical-details > div { padding: .8rem; background: var(--soft); border: 1px solid var(--border); border-radius: .5rem; }
.crew-medical-details dt { color: var(--muted); font-weight: 700; margin-bottom: .4rem; }
.crew-medical-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.crew-skills-list { display: flex; flex-wrap: wrap; list-style: none; padding: 0; gap: .6rem; }
.crew-skills-list li { padding: .6rem .9rem; background: var(--soft); border: 1px solid var(--border); border-radius: .6rem; }
@media (max-width: 560px) { .crew-medical-details { grid-template-columns: 1fr; } }

.invitation-tracking-panel { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--theme-line, #c8e1e8); border-radius: 16px; }
.invitation-tracking-card { margin-top: 1rem; padding: 1rem; background: var(--theme-surface, #f6fafb); border-radius: 12px; }
.invitation-table-scroll { overflow-x: auto; }
.invitation-tracking-card table { width: 100%; border-collapse: collapse; min-width: 560px; }
.invitation-tracking-card td, .invitation-tracking-card th { text-align: left; padding: .6rem; border-bottom: 1px solid var(--theme-line, #dce7eb); }
.invitation-tracking-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }

/* Planning hebdomadaire : journées alignées, formulaires contextuels. */
.menu-week {
  min-width: 0;
  overflow-x: visible;
  padding-bottom: 1rem;
}

.menu-week > h3 {
  margin: 1.15rem 0 .9rem;
}

.menu-week-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 1rem;
  align-items: stretch;
  min-width: 0;
}

.menu-week-grid .menu-day-card {
  background: var(--panel);
  display: grid;
  grid-template-rows: auto minmax(275px, 1fr) minmax(275px, 1fr);
  align-content: stretch;
  align-items: stretch;
  min-height: 690px;
  min-width: 0;
  overflow-wrap: normal;
  padding: .75rem;
}

.menu-week-grid .menu-day-header {
  align-items: flex-start;
  flex-direction: column;
  gap: .45rem;
}

.menu-week-grid .menu-meal-header {
  align-items: flex-start;
  flex-direction: column;
  gap: .38rem;
}

.menu-week-grid h3 {
  font-size: 1rem;
  line-height: 1.2;
  text-transform: capitalize;
}

.menu-week-grid h4 {
  font-size: .94rem;
  line-height: 1.22;
}

.menu-week-grid .link-button {
  display: inline-flex;
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.15;
  padding: .38rem .5rem;
  text-align: left;
  white-space: normal;
}

.menu-week-grid .menu-meal {
  align-content: start;
  display: grid;
  gap: .45rem;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow: hidden;
}

.menu-week-grid .menu-meal.is-empty {
  background: var(--theme-raised, rgba(245, 238, 227, .48));
  border: 1px dashed var(--theme-line, rgba(137, 104, 55, .28));
  border-radius: 8px;
  margin-top: .7rem;
  padding: .65rem;
}

.menu-week-grid .menu-meal:not(.is-empty) {
  border: 1px solid var(--theme-line, rgba(202, 221, 226, .9));
  border-radius: 8px;
  margin-top: .7rem;
  padding: .65rem;
}

.menu-week-grid .menu-meal.is-empty .request-meta {
  margin: 0;
}

.menu-week-grid .menu-meal.is-empty .link-button {
  background: var(--theme-surface, #fff);
}

.menu-week-grid .menu-ingredients-button {
  justify-content: flex-start;
  justify-self: start;
  max-width: 100%;
}

.menu-week-grid .request-meta,
.menu-week-grid .request-notes,
.menu-week-grid .menu-requirements {
  font-size: .84rem;
  line-height: 1.35;
}

.menu-week-grid .request-notes {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.menu-week-grid .menu-requirements {
  max-height: 3.8rem;
  overflow: hidden;
}

.menu-week-grid .menu-cook-identity {
  margin: .45rem 0;
}
.menu-cook-identity { display: flex; align-items: center; gap: .4rem; margin: .6rem 0; font-weight: 700; font-size: .85rem; }
.menu-cook-identity .crew-avatar { flex-shrink: 0; }
.menu-planning-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.menu-action-dialog { width: min(94vw, 550px); max-height: 90vh; overflow: auto; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); }
.menu-action-dialog::backdrop { background: var(--theme-emphasis, rgba(23,49,60,.45)); }
.menu-action-dialog .mini-form { border: 0; padding: 0; }
.menu-dialog-allergies { background: var(--theme-raised, #fff4df); color: var(--theme-ink, #604617); padding: .7rem; border-radius: 8px; }
.menu-dialog-allergies p { margin: .4rem 0; }
.menu-workbench { display: block; }
@media (max-width: 700px) {
  .menu-week-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .menu-day-placeholder { display: none; }
  .menu-week-grid .menu-day-card { padding: 1rem; }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .menu-week-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .menu-day-placeholder { display: none; }
}

.menu-allergy-panel { background: var(--panel); border-color: var(--border); }
.menu-allergy-list p.menu-allergy-declared, .menu-dialog-allergies p.menu-allergy-declared { color: var(--sp-error-ink, #b42318); }
.menu-allergy-list p.menu-allergy-none, .menu-dialog-allergies p.menu-allergy-none { color: var(--theme-ink, #176b39); }
.menu-allergy-list p.menu-allergy-unknown, .menu-dialog-allergies p.menu-allergy-unknown { color: var(--theme-ink, #52636b); }

.menu-allergy-panel.has-declared-allergies { border-color: var(--sp-error-line, #e6a49d); background: var(--sp-error-bg, #fff7f5); }
.menu-allergy-panel.has-no-known-allergies { border-color: var(--sp-success-line, #91c7a2); background: var(--sp-success-bg, #f0faf3); }
.menu-allergy-panel.has-declared-allergies h3 { color: var(--sp-error-ink, #b42318); }
.menu-allergy-panel.has-no-known-allergies h3 { color: var(--sp-success-ink, #176b39); }

#requestPanel { display: block; }
#requestPanel[hidden] { display: none !important; }
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] #purchasePanel {
  order: 4;
}
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] #requestPanel {
  order: 5;
  width: 100%;
  margin-inline: 0;
}
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] .purchase-panel {
  gap: .8rem;
}
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] .purchase-header {
  padding-bottom: .4rem;
}
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] .stopover-shopping-form {
  max-width: none;
  background: var(--theme-surface, rgba(244, 252, 252, .95));
}
.workspace[data-view="provisioning"][data-provisioning-tab="needs"] .list-panel {
  box-shadow: var(--shadow-soft);
}
.provisioning-header { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.provisioning-header h2 { margin: 0; }
.provisioning-workflow { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; padding: 1rem; background: var(--theme-raised, #edf7f8); border-radius: 8px; margin-bottom: 1rem; font-weight: 700; }
.provisioning-request-group { display: grid; gap: .6rem; margin-bottom: 1rem; }
.provisioning-request-group > h3 { margin: .5rem 0; }
.provisioning-request-group > button { justify-self: start; }

/* Etat durable des besoins : distinct du compteur de notifications. */
.provision-purchase-summary { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; background: var(--panel-soft); }
.provision-purchase-summary[hidden] { display: none; }
.provision-purchase-summary > h3 { margin: 0 0 .75rem; }
.provision-purchase-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.provision-purchase-count { display: grid; gap: .3rem; padding: .7rem; border-radius: 9px; background: var(--theme-surface, #fff); border: 1px solid var(--border); }
.provision-purchase-count strong { font-size: 1.5rem; line-height: 1.1; }
.provision-purchase-count span { color: var(--muted); font-size: .89rem; }
.provision-purchase-summary > p { margin: .7rem 0 0; color: var(--primary-dark); }
.request-stage-note { margin: .45rem 0 0; font-size: .87rem; color: var(--muted); }
.request-card .status-pill.stage-received { background: var(--sp-pending-bg, #fff3dd); color: var(--sp-pending-ink, #825000); }
.request-card .status-pill.stage-in-list { background: var(--theme-raised, #e5f3fb); color: var(--theme-ink, #14516f); }
.request-card .status-pill.stage-purchased { background: var(--sp-success-bg, #e4f6e9); color: var(--sp-success-ink, #146037); }
.request-card .status-pill.stage-other { background: var(--theme-raised, #f0eef2); color: var(--theme-ink, #574c66); }
@media (max-width: 620px) {
  .provision-purchase-counts { grid-template-columns: 1fr; }
  .provision-purchase-summary { padding: .7rem; }
}

/* Notifications d'avitaillement : cartes distinctes des besoins existants. */
.provision-changes-panel {
  display: grid;
  gap: .7rem;
  padding: 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}
.provision-changes-panel[hidden] { display: none; }
.provision-changes-panel > h3 { margin: 0; }
.provision-change-summary { margin: 0; color: var(--muted); }
.provision-change-card {
  display: grid;
  justify-items: start;
  gap: .45rem;
  padding: 1rem;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.provision-change-card h4, .provision-change-card p { margin: 0; overflow-wrap: anywhere; }
.provision-change-top { display: flex; width: 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.provision-change-top time, .provision-change-owner { color: var(--muted); font-size: .9rem; }
.provision-change-badge { display: inline-block; border-radius: 999px; padding: .25rem .65rem; font-weight: 750; font-size: .85rem; }
.provision-change-badge.is-new { background: var(--theme-raised, #e8f7ef); color: var(--theme-ink, #147a45); }
.provision-change-badge.is-modified { background: var(--theme-raised, #fff3dd); color: var(--theme-ink, #8a5300); }
.provision-change-quantity { font-weight: 700; }
.provision-change-details { width: 100%; display: grid; justify-items: start; gap: .55rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.provision-change-details[hidden] { display: none; }
@media (max-width: 620px) {
  .provision-changes-panel { padding: .7rem; }
  .provision-change-card { padding: .8rem; }
  .provision-change-card > button { width: 100%; }
}
#draftRequestsSection, #requestHistorySection { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
#draftRequestsSection summary, #requestHistorySection summary { cursor: pointer; font-weight: 700; margin-bottom: 1rem; }
#requestFormDialog .request-form { border: 0; box-shadow: none; padding: 0; }

.menu-recipe-link { display: inline-block; margin: .5rem 0; font-weight: 700; }

.provisioning-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .75rem 0 1rem;
  width: 100%;
}

.provisioning-subnav .module-tab {
  flex: 0 1 auto;
  min-height: 42px;
  padding: .65rem 1rem;
}

.provisioning-subnav .is-active {
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, white);
}

.purchase-shared-controls {
  margin: .35rem 0 .75rem;
  max-width: 650px;
}

.purchase-grid {
  grid-template-columns: minmax(0, 1fr);
}

.purchase-progress-person {
  padding: .7rem 0;
  border-top: 1px solid var(--border);
}

.purchase-summary progress {
  width: 100%;
  height: 1rem;
  accent-color: var(--primary-dark);
}

.purchase-store-finder summary {
  cursor: pointer;
  font-weight: 700;
}

.purchase-store-finder label {
  display: grid;
  gap: .4rem;
  margin: .7rem 0;
}

@media (min-width: 960px) {
  .purchase-panel {
    padding: 1.15rem;
  }

  .purchase-grid {
    gap: 1rem;
  }
}

@media (max-width: 700px) {
  .purchase-header,
  .stopover-shopping-heading {
    grid-template-columns: 1fr;
  }

  .purchase-header .secondary-button,
  .stopover-shopping-heading .secondary-button {
    justify-self: start;
  }
}

/* v148: visual refresh inspired by modern coastal apps. */
.topbar {
  padding: 0.9rem 0 1.25rem;
}

.topbar h1 {
  color: var(--theme-ink, #0f2f3f);
  letter-spacing: -0.03em;
}

.panel-form,
.request-form,
.list-panel,
.home-panel,
.crew-panel,
.menu-panel,
.purchase-panel,
.cash-panel,
.chat-panel,
.communication-panel,
.boat-panel {
  border-color: var(--theme-line, rgba(9, 72, 97, 0.12));
  background: var(--theme-surface, rgba(255, 255, 255, 0.94));
  box-shadow: var(--theme-shadow, 0 18px 42px rgba(10, 58, 76, 0.09));
}

.workspace > .module-nav,
.toolbar,
.status-strip {
  border-color: var(--theme-line, rgba(9, 72, 97, 0.12));
  background: var(--theme-surface, rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(14px);
}

.module-tab {
  border-color: transparent;
  background: var(--theme-surface, rgba(255, 255, 255, 0.88));
  color: var(--primary-dark);
  box-shadow: none;
}

.module-tab:hover {
  background: var(--theme-tint, #eef7f8);
}

.module-tab.is-active {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.2));
}

.primary-button,
.secondary-button,
.ghost-button,
.module-tab {
  border-radius: 10px;
}

.primary-button {
  background: var(--theme-emphasis, var(--primary-dark));
  box-shadow: var(--theme-shadow, 0 10px 22px rgba(8, 61, 86, 0.18));
}

.primary-button:hover {
  background: var(--theme-emphasis, #062f43);
}

.secondary-button {
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.14));
  background: var(--theme-raised, #eef7f8);
  color: var(--primary-dark);
  box-shadow: none;
}

.secondary-button:hover {
  background: var(--theme-tint, #dceff2);
}

.ghost-button {
  background: var(--theme-raised, #eef7f8);
  color: var(--primary-dark);
}

.secondary-button.is-active-action,
.ghost-button.is-active-action {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.18));
}

.secondary-button.is-active-action:hover,
.ghost-button.is-active-action:hover {
  background: var(--theme-emphasis, #062f43);
}

.home-cruise-card,
.home-welcome-panel,
.home-crew-panel,
.home-notification-panel,
.menu-recipe-card,
.home-duty-item,
.home-crew-item {
  border-color: var(--theme-line, rgba(9, 72, 97, 0.12));
  border-radius: 10px;
}

.home-cruise-card {
  background:
    var(--theme-surface, linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 239, 224, 0.52)),
    linear-gradient(180deg, #fff 0%, #f4fafb 100%));
}

.home-cruise-map-status,
.status-strip {
  background: var(--theme-raised, #eef7f8);
}

.menu-allergy-panel.has-declared-allergies {
  border-color: var(--sp-error-line, rgba(233, 111, 95, 0.38));
  background: var(--sp-error-bg, #fff6f3);
}

.menu-allergy-panel.has-no-known-allergies {
  border-color: var(--sp-success-line, rgba(23, 162, 166, 0.28));
  background: var(--sp-success-bg, #f3fbf9);
}

.menu-recipe-type,
.home-welcome-panel span,
.home-section-header span,
.home-cruise-card-header span {
  color: var(--theme-ink, #0c7890);
}

body.is-authenticated .return-to-menu {
  background: var(--theme-emphasis, var(--primary-dark));
  border-radius: 999px;
}

/* v152: home dashboard polish. */
.home-panel {
  gap: 1.25rem;
}

.home-cruise-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 1.15rem;
}

.home-cruise-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--primary-dark), var(--accent));
}

.home-cruise-card > * {
  position: relative;
}

.home-cruise-card-header h3 {
  color: var(--primary-dark);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}

.home-cruise-details div {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 10px;
  background: var(--theme-surface, rgba(255, 255, 255, 0.78));
}

.home-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--theme-line, rgba(8, 61, 86, 0.1));
  padding-top: 0.35rem;
}

.home-section-title span {
  color: var(--theme-ink, #0c7890);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section-title h3 {
  margin: 0.15rem 0 0;
  color: var(--primary-dark);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.home-grid {
  gap: 1rem;
}

.crew-dashboard {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background:
    var(--theme-raised, linear-gradient(135deg, rgba(230, 247, 248, 0.96) 0%, rgba(255, 252, 244, 0.9) 100%));
  padding: 1.1rem;
  box-shadow: var(--theme-shadow, 0 12px 30px rgba(10, 58, 76, 0.09));
}

.crew-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.crew-dashboard-card {
  display: grid;
  gap: 0.35rem;
  min-height: 126px;
  align-content: start;
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.13));
  border-radius: 13px;
  background: var(--theme-surface, rgba(255, 255, 255, 0.9));
  color: var(--text);
  padding: 0.95rem;
  text-align: left;
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.07));
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.crew-dashboard-card:hover {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.24));
  box-shadow: var(--theme-shadow, 0 16px 32px rgba(10, 58, 76, 0.12));
  transform: translateY(-2px);
}

.crew-dashboard-card.primary {
  border-color: var(--theme-line, rgba(12, 120, 144, 0.26));
  background: var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(235, 249, 250, 0.96) 100%));
}

.crew-dashboard-card span {
  color: var(--theme-ink, #0c7890);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.crew-dashboard-card strong {
  color: var(--primary-dark);
  font-size: 1.22rem;
  line-height: 1.15;
}

.crew-dashboard-card small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.module-card {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background:
    var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 251, 0.94) 100%));
  box-shadow: var(--theme-shadow, 0 12px 28px rgba(10, 58, 76, 0.08));
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-card:hover {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.22));
  box-shadow: var(--theme-shadow, 0 18px 36px rgba(10, 58, 76, 0.13));
  transform: translateY(-2px);
}

.module-card span {
  color: var(--theme-ink, #0c7890);
  letter-spacing: 0.06em;
}

.module-card strong {
  color: var(--primary-dark);
}

.home-priorities,
.skipper-cruise-home,
.home-duty-panel {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background: var(--theme-surface, rgba(255, 255, 255, 0.9));
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.07));
}

.home-priority-actions .module-card,
.skipper-cruise-list .module-card {
  min-height: 120px;
}

/* v156: harmonize remaining module accents with the new coastal identity. */
.provisioning-subnav .module-tab,
.cash-tabs .module-tab,
.menu-planning-actions .secondary-button,
.purchase-shared-controls .secondary-button {
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.14));
  background: var(--theme-raised, rgba(238, 247, 248, 0.92));
  color: var(--primary-dark);
  box-shadow: none;
}

.provisioning-subnav .module-tab:hover,
.cash-tabs .module-tab:hover,
.menu-planning-actions .secondary-button:hover,
.purchase-shared-controls .secondary-button:hover {
  background: var(--theme-tint, rgba(247, 239, 224, 0.72));
  border-color: var(--theme-line, rgba(8, 61, 86, 0.22));
}

.provisioning-subnav .module-tab.is-active,
.provisioning-subnav .is-active,
.cash-tabs .module-tab.is-active,
.cash-tabs .is-active {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-ink, #fff);
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.18));
}

.purchase-progress span,
.purchase-summary progress {
  accent-color: var(--primary-dark);
}

.purchase-progress span {
  background: var(--theme-emphasis, linear-gradient(90deg, var(--primary-dark), #0b6f8f));
}

.status-pill.sent,
.status-pill.done {
  background: var(--theme-raised, rgba(247, 239, 224, 0.78));
  color: var(--primary-dark);
}

.chat-panel[data-room-type="SkipperTeam"] .chat-status,
.chat-panel[data-room-type="SkipperTeam"] .chat-message.mine,
.chat-panel[data-room-type="SkipperNetwork"] .chat-status,
.chat-panel[data-room-type="SkipperNetwork"] .chat-message.mine {
  background: var(--theme-raised, rgba(247, 239, 224, 0.62));
}

.menu-recipe-type,
.home-welcome-panel span,
.home-section-header span,
.home-cruise-card-header span,
.home-section-title span,
.module-card span {
  color: var(--theme-ink, #7a5b27);
}

.home-cruise-card::before {
  background: linear-gradient(180deg, var(--primary-dark), var(--sun));
}

.home-cruise-map-status,
.status-strip,
.link-button,
.provisioning-workflow {
  background: var(--theme-raised, rgba(247, 239, 224, 0.56));
  color: var(--primary-dark);
}

.menu-allergy-panel.has-no-known-allergies {
  border-color: var(--sp-success-line, rgba(8, 61, 86, 0.16));
  background: var(--sp-success-bg, rgba(238, 247, 248, 0.74));
}

/* v157: calmer board cash actions and cards. */
.cash-panel {
  border-radius: 16px;
  gap: 1.4rem;
}

.cash-header {
  align-items: center;
}

.cash-header p,
.cash-card p,
.cash-section p,
.cash-payment-section p,
.cash-closure-section p {
  color: var(--muted);
}

.cash-overview article,
.cash-card,
.cash-section,
.cash-payment-section,
.cash-closure-section,
.cash-from-ticket,
.cash-ocr-review {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background:
    var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 251, 0.92)));
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.06));
}

.cash-overview span,
.cash-card .form-help {
  color: var(--theme-ink, #617985);
}

.cash-panel button {
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.14));
  border-radius: 10px;
  background: var(--theme-raised, rgba(238, 247, 248, 0.94));
  color: var(--primary-dark);
  box-shadow: none;
}

.cash-panel button:hover {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.22));
  background: var(--theme-tint, rgba(247, 239, 224, 0.72));
}

#cashRefresh,
#cashExpense button[type="submit"],
#cashPayment button[type="submit"],
#cashClose {
  border-color: transparent;
  background: var(--theme-emphasis, var(--primary-dark));
  color: var(--theme-link, #fff);
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.18));
}

#cashRefresh:hover,
#cashExpense button[type="submit"]:hover,
#cashPayment button[type="submit"]:hover,
#cashClose:hover {
  background: var(--theme-emphasis, #062f43);
}

#cashSettings button[type="submit"],
#cashPreference button[type="submit"],
#cashOnlineRate,
#cashReadNewReceipt,
#cashManualNewReceipt,
#cashAllMembers {
  background: var(--theme-raised, rgba(247, 239, 224, 0.78));
  color: var(--primary-dark);
}

#cashSettings button[type="submit"]:hover,
#cashPreference button[type="submit"]:hover,
#cashOnlineRate:hover,
#cashReadNewReceipt:hover,
#cashManualNewReceipt:hover,
#cashAllMembers:hover {
  background: var(--theme-tint, #f2e5cf);
}

#cashClearNewReceipt,
#cashCancel,
#cashReopen {
  background: var(--theme-surface, #fff6f3);
  color: var(--danger);
  border-color: var(--theme-line, rgba(180, 35, 24, 0.18));
}

.cash-panel button:disabled {
  background: var(--sp-disabled-bg, #e7eef0);
  color: var(--sp-disabled-ink, #6c7d84);
  border-color: var(--sp-disabled-line, rgba(8, 61, 86, 0.08));
  box-shadow: none;
}

.cash-file-picker,
.cash-receipts .cash-file-picker,
.cash-from-ticket .cash-file-picker {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.16));
  background: var(--theme-raised, rgba(238, 247, 248, 0.94));
  color: var(--primary-dark);
}

/* v159: communication module polish. */
.communication-panel {
  border-radius: 16px;
  gap: 1.35rem;
}

.communication-header {
  align-items: center;
}

.communication-form {
  display: grid;
  gap: 1rem;
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background:
    var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 251, 0.92)));
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.06));
}

.communication-form .field-hint {
  color: var(--muted);
  font-weight: 800;
}

.communication-form textarea {
  min-height: 8rem;
}

#communicationSubmitButton {
  width: 100%;
  border-radius: 12px;
  background: var(--theme-emphasis, var(--primary-dark));
  box-shadow: var(--theme-shadow, 0 12px 26px rgba(8, 61, 86, 0.18));
}

#communicationSubmitButton:hover {
  background: var(--theme-emphasis, #062f43);
}

.communication-list {
  gap: 1rem;
}

.communication-item {
  position: relative;
  overflow: hidden;
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 14px;
  background:
    var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 251, 0.92)));
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.06));
}

.communication-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--theme-emphasis, var(--primary-dark));
}

.communication-item[data-importance="Important"] {
  border-color: var(--theme-line, rgba(244, 183, 97, 0.45));
}

.communication-item[data-importance="Important"]::before {
  background: var(--sun);
}

.communication-item[data-importance="Urgent"] {
  border-color: var(--sp-critical-line, rgba(233, 111, 95, 0.45));
}

.communication-item[data-importance="Urgent"]::before {
  background: var(--coral);
}

.communication-item > * {
  position: relative;
}

.communication-importance {
  border-color: var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 999px;
  background: var(--theme-raised, rgba(247, 239, 224, 0.72));
  color: var(--primary-dark);
}

.communication-item[data-importance="Urgent"] .communication-importance {
  background: var(--sp-critical-bg, #fff6f3);
  color: var(--danger);
  border-color: var(--sp-critical-line, rgba(180, 35, 24, 0.18));
}

.communication-item button {
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.14));
  border-radius: 10px;
  background: var(--theme-raised, rgba(238, 247, 248, 0.94));
  color: var(--primary-dark);
  box-shadow: none;
}

.communication-item button:hover {
  background: var(--theme-tint, rgba(247, 239, 224, 0.72));
}

/* v160: cleanup audit tool. */
.cleanup-audit-panel {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.12));
  border-radius: 16px;
  padding: 1rem;
  background:
    var(--theme-surface, linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 251, 0.92)));
  box-shadow: var(--theme-shadow, 0 10px 24px rgba(10, 58, 76, 0.06));
}

.cleanup-audit-panel > p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cleanup-audit-results {
  display: grid;
  gap: 1rem;
}

.cleanup-audit-section {
  display: grid;
  gap: .75rem;
}

.cleanup-audit-section h4 {
  margin: 0;
  color: var(--primary-dark);
}

.cleanup-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
}

.cleanup-audit-metric {
  display: grid;
  gap: .25rem;
  border: 1px solid var(--theme-line, rgba(8, 61, 86, 0.1));
  border-radius: 12px;
  padding: .8rem;
  background: var(--theme-raised, rgba(238, 247, 248, 0.72));
}

.cleanup-audit-metric span,
.cleanup-audit-metric small {
  color: var(--muted);
  font-weight: 800;
}

.cleanup-audit-metric strong {
  color: var(--primary-dark);
  font-size: 1.25rem;
}

.cleanup-audit-notes {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-weight: 700;
}

.cleanup-audit-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cleanup-unknown-file-list {
  display: grid;
  gap: .65rem;
}

.cleanup-unknown-file {
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(220px, 1fr) auto;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--theme-line, rgba(233, 111, 95, 0.18));
  border-radius: 12px;
  padding: .8rem;
  background: var(--theme-surface, #fffaf7);
}

.cleanup-unknown-file strong {
  color: var(--primary-dark);
}

.cleanup-unknown-file span,
.cleanup-unknown-file small {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .cleanup-unknown-file {
    grid-template-columns: 1fr;
  }
}


/* Stabilise les onglets du plan de menu pour éviter les sauts de page. */
.menu-planning-body,
.menu-tab-panel,
#menuPlanningPanel,
#menuCatalogPanel,
#localCuisinePanel,
#allergyPanel {
  min-height: 620px;
}


/* Stabilise les 4 panneaux du plan de menu pour éviter les sauts d'affichage. */
#menuPanel .menu-tab-panel {
  min-height: 760px;
}


/* Mise en page compacte des actions de la proposition du skipper. */
.menu-skipper-idea-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  max-width: 720px;
}

.menu-skipper-idea-actions .secondary-button,
.menu-skipper-idea-actions .primary-button {
  min-width: 0;
  white-space: nowrap;
}

.menu-skipper-idea-actions .primary-button {
  margin-left: 8px;
}

@media (max-width: 860px) {
  .menu-skipper-idea-actions {
    justify-content: flex-start;
  }

  .menu-skipper-idea-actions .primary-button {
    margin-left: 0;
  }
}

/* Actions proposition du skipper : barre compacte. */
.menu-skipper-idea-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.menu-skipper-idea-actions .secondary-button,
.menu-skipper-idea-actions .primary-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: none;
  white-space: nowrap;
}

.menu-skipper-idea-actions .secondary-button {
  background: var(--theme-surface, #f7fbfb);
  border: 1px solid var(--theme-line, #cfe3e8);
  color: var(--theme-ink, #07364a);
}

.menu-skipper-idea-actions .primary-button {
  background: var(--theme-emphasis, #0f4c63);
}

@media (max-width: 760px) {
  .menu-skipper-idea-actions {
    justify-content: flex-start;
  }
}

/* Correction forte : boutons des propositions du skipper en format compact. */
#menuSkipperIdeaPdfButton,
#menuSkipperIdeaExportButton,
#menuSkipperIdeaImportButton,
#menuSkipperIdeaToggleButton {
  min-height: var(--sp-control-height, 44px);
  padding: 6px 10px !important;
  border-radius: 7px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  box-shadow: none !important;
  width: auto !important;
  max-width: none !important;
}

#menuSkipperIdeaPdfButton,
#menuSkipperIdeaExportButton,
#menuSkipperIdeaImportButton {
  background: var(--theme-surface, #f8fbfb) !important;
  border: 1px solid var(--theme-line, #cfe3e8) !important;
  color: var(--theme-ink, #07364a) !important;
}

#menuSkipperIdeaToggleButton {
  background: var(--theme-emphasis, #0f4c63) !important;
  border: 1px solid var(--theme-line, #0f4c63) !important;
  color: var(--theme-ink, #ffffff) !important;
}

.menu-skipper-idea-actions {
  gap: 6px !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

/* Largeur uniforme des actions proposition du skipper. */
#menuSkipperIdeaPdfButton,
#menuSkipperIdeaExportButton,
#menuSkipperIdeaImportButton,
#menuSkipperIdeaToggleButton {
  width: 210px !important;
  text-align: center !important;
}


.menu-ingredients-summary {
  color: var(--theme-ink, #607785);
  font-weight: 700;
  margin-top: 12px;
}


.cash-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
  padding: 8px;
  border: 1px solid var(--theme-line, #d9eaee);
  border-radius: 12px;
  background: var(--theme-surface, #f7fbfb);
}

.cash-subnav button {
  border: 1px solid var(--theme-line, #cfe5eb);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #07364a);
  font-weight: 800;
  cursor: pointer;
}

.cash-subnav button.is-active {
  border-color: var(--theme-line, #0f6b8f);
  background: var(--theme-emphasis, #0f6b8f);
  color: var(--theme-ink, #ffffff);
}

.cash-tab-hidden {
  display: none !important;
}

/* Caisse de bord: onglets et actions plus stables */
.cash-header {
  align-items: flex-start;
  gap: 18px;
}

.cash-header .cash-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 620px;
}

.cash-subnav {
  align-items: center;
}

.cash-subnav button:first-child,
.cash-subnav button.is-active {
  border-color: var(--theme-line, #0f6b8f);
  background: var(--theme-emphasis, #0f6b8f);
  color: var(--theme-ink, #ffffff);
}

@media (max-width: 860px) {
  .cash-header {
    flex-direction: column;
  }

  .cash-header .cash-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .cash-subnav button {
    flex: 1 1 160px;
  }
}




/* Caisse de bord: onglets fonctionnels */
#cashSubnav button.cash-tab-active,
#cashSubnav button.is-active,
#cashSubnav button[aria-pressed="true"] {
  border-color: var(--theme-line, #0f6b8f) !important;
  background: var(--theme-emphasis, #0f6b8f) !important;
  color: var(--theme-ink, #ffffff) !important;
  box-shadow: var(--theme-shadow, 0 12px 24px rgba(15, 107, 143, 0.18));
}
/* Fin Caisse de bord: onglets fonctionnels */








/* Chat: états actifs SailProvision */
#chatPanel button.chat-input-mode-active {
  color: var(--theme-ink, #ffffff) !important;
}
/* Fin Chat: états actifs SailProvision */


#exportMenuPlanCsvButton.is-active {
  background: var(--theme-emphasis, #07364a);
  border-color: var(--theme-line, #07364a);
  color: var(--theme-ink, #ffffff);
}


/* Mobile iPhone/iPad: accueil et navigation */
@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .workspace,
  main,
  .home-panel,
  .crew-panel,
  .menu-panel,
  .request-grid,
  .shopping-panel,
  .chat-panel,
  .communication-panel,
  .cash-panel,
  .boat-panel {
    max-width: 100%;
    overflow-x: hidden;
  }

  .home-header,
  .crew-dashboard-header,
  .toolbar,
  .crew-header,
  .menu-header,
  .shopping-header,
  .chat-header,
  .communication-header,
  .cash-header,
  .boat-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .home-header > *,
  .crew-dashboard-header > *,
  .toolbar > *,
  .crew-header > *,
  .menu-header > *,
  .shopping-header > *,
  .chat-header > *,
  .communication-header > *,
  .cash-header > *,
  .boat-header > * {
    min-width: 0;
  }

  #logoutButton {
    max-width: 100%;
    white-space: nowrap;
  }

  .module-nav,
  .menu-subnav,
  .provisioning-subnav,
  .cash-tabs,
  .chat-mode-tabs,
  .home-module-grid,
  .crew-dashboard-grid {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar,
  .menu-subnav::-webkit-scrollbar,
  .provisioning-subnav::-webkit-scrollbar,
  .cash-tabs::-webkit-scrollbar,
  .chat-mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-nav button,
  .menu-subnav button,
  .provisioning-subnav button,
  .cash-tabs button,
  .chat-mode-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  select,
  input,
  textarea,
  button {
    max-width: 100%;
  }
}
/* Fin mobile iPhone/iPad */


/* Mobile iPhone/iPad: cadrage final */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
  }

  .app-shell,
  .workspace,
  .home-panel,
  .crew-panel,
  .menu-panel,
  .request-grid,
  .shopping-panel,
  .chat-panel,
  .communication-panel,
  .cash-panel,
  .boat-panel {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .app-header,
  .home-header,
  .toolbar,
  .crew-header,
  .menu-header,
  .shopping-header,
  .chat-header,
  .communication-header,
  .cash-header,
  .boat-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  #logoutButton {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .module-nav,
  .menu-subnav,
  .provisioning-subnav,
  .cash-tabs,
  .chat-mode-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100vw;
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar,
  .menu-subnav::-webkit-scrollbar,
  .provisioning-subnav::-webkit-scrollbar,
  .cash-tabs::-webkit-scrollbar,
  .chat-mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-nav button,
  .menu-subnav button,
  .provisioning-subnav button,
  .cash-tabs button,
  .chat-mode-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .module-card,
  .crew-dashboard-card,
  .crew-card,
  .home-card,
  .dashboard-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  .return-to-menu {
    left: auto !important;
    right: 14px !important;
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 28px);
    padding: 12px 16px !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    white-space: nowrap;
  }

  .return-to-menu::first-letter {
    text-transform: uppercase;
  }
}
/* Fin mobile iPhone/iPad: cadrage final */


/* Mobile iPhone/iPad: actions accueil plus légères */
@media (max-width: 720px) {
  .home-todo-card,
  .home-next-actions,
  .home-actions,
  .home-priority-actions {
    max-width: 100%;
  }

  .home-todo-card button,
  .home-next-actions button,
  .home-actions button,
  .home-priority-actions button,
  .home-todo-card .secondary-button,
  .home-todo-card .ghost-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 750;
    text-align: center;
    justify-content: center;
    box-shadow: none;
  }

  .home-todo-card button + button,
  .home-next-actions button + button,
  .home-actions button + button,
  .home-priority-actions button + button {
    margin-top: 10px;
  }

  .home-todo-card .primary-button,
  .home-next-actions .primary-button,
  .home-actions .primary-button,
  .home-priority-actions .primary-button {
    background: var(--theme-emphasis, #07364a);
    border-color: var(--theme-line, #07364a);
    color: var(--theme-ink, #ffffff);
  }

  .home-todo-card .secondary-button,
  .home-next-actions .secondary-button,
  .home-actions .secondary-button,
  .home-priority-actions .secondary-button,
  .home-todo-card .ghost-button,
  .home-next-actions .ghost-button,
  .home-actions .ghost-button,
  .home-priority-actions .ghost-button {
    background: var(--theme-surface, #f3fafb);
    border: 1px solid var(--theme-line, #d5e8ed);
    color: var(--theme-ink, #07364a);
  }
}
/* Fin mobile iPhone/iPad: actions accueil plus légères */


/* Mobile iPhone/iPad: équipage et bouton retour */
@media (max-width: 720px) {
  #returnToMenuButton,
  .return-to-menu {
    right: 14px !important;
    left: auto !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: 170px !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    z-index: 50 !important;
  }

  .crew-header-actions,
  .crew-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
  }

  .crew-card {
    max-width: 100%;
    overflow: hidden;
  }

  .crew-card-header,
  .crew-card-identity {
    max-width: 100%;
    min-width: 0;
  }

  .crew-card-identity,
  .crew-card-identity h3,
  .crew-contact-link,
  .crew-card a[href^="mailto:"],
  .crew-card a[href^="tel:"] {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .crew-card-details,
  .crew-card-documents,
  .crew-card-actions {
    max-width: 100%;
    min-width: 0;
  }
}


/* Mobile iPhone/iPad: cartes équipage lisibles */
@media (max-width: 720px) {
  .crew-card-header {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
  }

  .crew-card-header img,
  .crew-card-photo,
  .crew-photo,
  .crew-avatar {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .crew-card-identity {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .crew-card-identity h3 {
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  .crew-contact-link,
  .crew-card-identity a[href^="mailto:"],
  .crew-card-identity a[href^="tel:"] {
    display: inline !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .crew-card-header > :not(img):not(.crew-card-identity):last-child {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    margin-top: 4px !important;
  }
}


/* Mobile iPhone/iPad: coordonnées équipage plus propres */
@media (max-width: 720px) {
  .crew-card-identity .crew-contact-link,
  .crew-card-identity a[href^="mailto:"],
  .crew-card-identity a[href^="tel:"] {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  .crew-card-identity h3 {
    font-size: 22px !important;
    line-height: 1.15 !important;
  }
}


/* Mobile iPhone/iPad: fiche équipage pleine largeur */
@media (max-width: 720px) {
  .crew-card-header {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: stretch !important;
    justify-items: stretch !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    column-gap: 12px !important;
  }

  .crew-card-identity {
    width: 100% !important;
    max-width: 100% !important;
  }

  .crew-card-identity h3 {
    white-space: normal !important;
  }

  .crew-card-identity .crew-contact-link,
  .crew-card-identity a[href^="mailto:"],
  .crew-card-identity a[href^="tel:"] {
    font-size: 17px !important;
    line-height: 1.22 !important;
  }
}


/* Mobile iPhone/iPad: retour rendu équipage propre */
@media (max-width: 720px) {
  .crew-card-header img,
  .crew-card-photo,
  .crew-photo,
  .crew-avatar {
    width: 56px !important;
    height: 56px !important;
    border-radius: 999px !important;
    object-fit: cover !important;
    flex: 0 0 auto !important;
  }

  .crew-card-identity h3 {
    font-size: 22px !important;
    line-height: 1.15 !important;
  }

  .crew-card-identity .crew-contact-link,
  .crew-card-identity a[href^="mailto:"],
  .crew-card-identity a[href^="tel:"] {
    font-size: 17px !important;
    line-height: 1.22 !important;
  }
}


/* Mobile iPhone/iPad: bouton retour moins envahissant */
@media (max-width: 720px) {
  #returnToMenuButton,
  .return-to-menu {
    right: 12px !important;
    left: auto !important;
    bottom: calc(18px + env(safe-area-inset-bottom)) !important;
    max-width: 142px !important;
    min-height: 40px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    border-radius: 999px !important;
  }
}



/* Avitaillement mobile: evite le debordement horizontal */
@media (max-width: 720px) {
  body,
  .app-shell,
  .workspace {
    overflow-x: hidden;
  }

  #provisioningSubnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    overflow: visible;
  }

  #provisioningSubnav button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
    padding: 12px 8px;
    text-align: center;
  }

  #requestPanel,
  #purchasePanel,
  .request-grid,
  .purchase-panel,
  .purchase-shared-controls,
  .purchase-assignment-card,
  .purchase-progress-summary {
    max-width: 100%;
    box-sizing: border-box;
  }

  .purchase-shared-controls select,
  #purchaseShoppingListSelect {
    width: 100%;
    max-width: 100%;
  }

  .purchase-assignment-card,
  .purchase-progress-summary {
    overflow-wrap: anywhere;
  }

  .purchase-assignment-card .secondary-button,
  .purchase-assignment-card .primary-button,
  .purchase-assignment-card .ghost-button {
    max-width: 100%;
    white-space: normal;
  }
}
/* Fin Avitaillement mobile */



/* Titres modules mobile: evite la coupe a gauche */
@media (max-width: 720px) {
  .workspace > section > h1,
  .workspace h1,
  .module-panel h1,
  .request-grid h2,
  .cash-panel h2,
  .communication-panel h2,
  .chat-panel h2 {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }

  .workspace > section,
  .module-panel,
  .request-grid,
  .cash-panel,
  .communication-panel,
  .chat-panel {
    max-width: 100%;
    box-sizing: border-box;
  }
}
/* Fin titres modules mobile */



/* Chat mobile: boutons de mode courts et lisibles */
@media (max-width: 720px) {
  #chatPanel .chat-compose-actions,
  #chatPanel .form-actions,
  #chatPanel .card-actions {
    gap: 10px;
  }

  #chatPanel button {
    max-width: 100%;
  }
}
/* Fin Chat mobile boutons */


/* SailProvision welcome page */
.welcome-panel {
  display: grid;
  gap: 1rem;
  padding-bottom: 2rem;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1rem;
  align-items: stretch;
}

.welcome-copy,
.welcome-side,
.welcome-feature-grid article,
.welcome-login-form {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.welcome-copy {
  display: grid;
  align-content: center;
  gap: 1rem;
  min-height: 330px;
  padding: clamp(1.4rem, 4vw, 3rem);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--accent));
  color: var(--theme-ink, #ffffff);
}

.welcome-copy .eyebrow,
.welcome-copy p {
  color: var(--theme-muted, rgba(255, 255, 255, 0.9));
}

.welcome-copy h2 {
  max-width: 11ch;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.96;
}

.welcome-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.welcome-actions a {
  text-decoration: none;
}

.welcome-side {
  display: grid;
  align-content: end;
  gap: 0.6rem;
  min-height: 330px;
  padding: 1.25rem;
  background: var(--theme-raised, linear-gradient(160deg, rgba(244, 183, 97, 0.22), rgba(255, 255, 255, 0.96), rgba(23, 162, 166, 0.18)));
}

.welcome-side span,
.welcome-feature-grid span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.welcome-side strong {
  color: var(--primary-dark);
  font-size: 1.45rem;
  line-height: 1.1;
}

.welcome-side p {
  color: var(--muted);
}

.welcome-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.welcome-feature-grid article {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--theme-surface, rgba(255, 255, 255, 0.94));
}

.welcome-feature-grid strong {
  color: var(--primary-dark);
}

.welcome-login-form {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  background: var(--theme-surface, rgba(255, 255, 255, 0.96));
}

@media (max-width: 860px) {
  .welcome-hero {
    grid-template-columns: 1fr;
  }

  .welcome-copy,
  .welcome-side {
    min-height: auto;
  }

  .welcome-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .welcome-feature-grid {
    grid-template-columns: 1fr;
  }

  .welcome-login-form {
    margin: 0;
  }
}
/* End SailProvision welcome page */


/* Welcome page compact tuning */
.welcome-panel {
  gap: 0.75rem;
}

.welcome-hero {
  gap: 0.8rem;
}

.welcome-copy,
.welcome-side {
  min-height: 285px;
}

.welcome-feature-grid {
  gap: 0.6rem;
}

.welcome-feature-grid article {
  padding: 0.85rem 1rem;
}

.welcome-login-form {
  margin-top: 0.25rem;
}



.skipper-assistant-panel {
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.16));
  border-radius: 16px;
  background: var(--theme-emphasis, linear-gradient(135deg, rgba(15, 107, 143, 0.08), rgba(255, 255, 255, 0.96)));
  box-shadow: var(--shadow-soft);
}

.skipper-assistant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.skipper-assistant-heading span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.skipper-assistant-heading p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.skipper-assistant-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.skipper-assistant-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 76px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--theme-surface, #ffffff);
  color: var(--text);
  text-align: left;
}

.skipper-assistant-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.skipper-assistant-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.skipper-assistant-body small {
  color: var(--muted);
  font-weight: 650;
}

.skipper-assistant-status {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--theme-raised, #eef6f7);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.skipper-assistant-step.is-done .skipper-assistant-status {
  background: var(--sp-success-bg, rgba(23, 162, 166, 0.14));
  color: var(--sp-success-ink, #0f6670);
}

@media (max-width: 780px) {
  .skipper-assistant-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .skipper-assistant-steps {
    grid-template-columns: 1fr;
  }
}


.crew-dashboard {
  border-left: 6px solid var(--primary);
}

.crew-dashboard .home-section-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.crew-dashboard-card strong {
  line-height: 1.15;
}

.crew-dashboard-card small {
  line-height: 1.25;
}


/* Assistant skipper · alignement visuel avec assistant équipier */
.skipper-assistant-panel {
  border-left: 6px solid var(--primary);
}

.skipper-assistant-heading span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* Assistant croisière */
.cruise-assistant-panel {
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid var(--theme-line, rgba(15, 107, 143, 0.16));
  border-left: 6px solid var(--primary);
  border-radius: 16px;
  background: var(--theme-emphasis, linear-gradient(135deg, rgba(15, 107, 143, 0.08), rgba(255, 255, 255, 0.96)));
  box-shadow: var(--shadow-soft);
}

.cruise-assistant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.cruise-assistant-heading span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cruise-assistant-heading p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.cruise-assistant-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.cruise-assistant-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 76px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--theme-surface, #ffffff);
  color: var(--text);
  text-align: left;
  box-shadow: var(--theme-shadow, 0 8px 18px rgba(10, 58, 76, 0.06));
}

.cruise-assistant-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.cruise-assistant-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cruise-assistant-body small {
  color: var(--muted);
  font-weight: 650;
}

.cruise-assistant-status {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--theme-raised, #eef6f7);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .cruise-assistant-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .cruise-assistant-steps {
    grid-template-columns: 1fr;
  }
}


/* Bouton login public */
.login-submit-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 56px !important;
  background: var(--theme-emphasis, var(--primary-dark)) !important;
  border: 0 !important;
  color: var(--theme-ink, #ffffff) !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  text-indent: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.login-submit-button::before,
.login-submit-button::after {
  content: none !important;
}


/* Bouton Embarquement formulaire */
#loginForm .login-submit-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 56px !important;
  background: var(--theme-emphasis, var(--primary-dark)) !important;
  color: var(--theme-ink, #ffffff) !important;
  font-weight: 900 !important;
  text-align: center !important;
  opacity: 1 !important;
}

/* Plan de menu : en-tête desktop */
@media (min-width: 781px) {
  #menuPanel > .menu-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  #menuPanel > .menu-header > div:first-child {
    width: 100%;
    min-width: 0;
  }

  #menuPanel > .menu-header > .menu-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
  }

  #menuPanel > .menu-header > .menu-actions > button {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
  }
}

/* Vitrine publique : captures des modules */
#loginPanel .public-vitrine {
  scroll-margin-top: 1.5rem;
  min-width: 0;
}
#loginPanel .vitrine-heading {
  margin-bottom: 1.25rem;
}
#loginPanel .vitrine-heading h2 {
  margin: .35rem 0 .5rem;
}
#loginPanel .vitrine-heading > p:last-child {
  color: var(--muted);
  max-width: 65ch;
}
#loginPanel .vitrine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
#loginPanel .vitrine-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
#loginPanel .vitrine-image-link {
  display: block;
  padding: .75rem;
  background: var(--panel-soft);
}
#loginPanel .vitrine-image-link img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: contain;
}
#loginPanel .vitrine-caption {
  padding: 1.25rem;
  border-left: 5px solid var(--primary);
}
#loginPanel .vitrine-caption p {
  margin: .5rem 0 .8rem;
  color: var(--muted);
}
#loginPanel .vitrine-caption a {
  color: var(--primary-dark);
  font-weight: 700;
}
#loginPanel #loginForm {
  scroll-margin-top: 1.5rem;
}
@media (max-width: 780px) {
  #loginPanel .vitrine-grid {
    grid-template-columns: 1fr;
  }
  #loginPanel .vitrine-image-link img {
    height: 280px;
  }
}

/* Bienvenue : un seul cadre aux couleurs SailProvision */
#loginPanel .welcome-hero {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--theme-emphasis, linear-gradient(120deg, #083d56 0%, #0b6f8f 55%, #17a2a6 100%));
  box-shadow: var(--shadow);
}
#loginPanel .welcome-copy {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--theme-ink, #ffffff);
}
#loginPanel .welcome-copy h2 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.12;
}
#loginPanel .welcome-copy p,
#loginPanel .welcome-copy .eyebrow {
  color: var(--theme-muted, #ffffff);
}
#loginPanel .welcome-shared-message {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--theme-line, rgba(255, 255, 255, .3));
}
#loginPanel .welcome-shared-message h3 {
  color: var(--theme-ink, #ffffff);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}
#loginPanel .welcome-shared-message p {
  margin-top: .5rem;
}
#loginPanel .welcome-actions {
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Bienvenue et connexion : présentation compacte */
#loginPanel .welcome-copy {
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
#loginPanel .welcome-copy h2 {
  margin-top: 0;
}
#loginPanel #loginForm {
  width: min(440px, 100%);
  max-width: 440px;
  margin: 1.25rem auto 0;
  padding: 1.25rem;
  gap: .8rem;
  min-width: 0;
}
#loginPanel #loginForm h2 {
  font-size: 1.35rem;
}
#loginPanel #loginForm > div:first-child p {
  margin-top: .25rem;
  font-size: .9rem;
}
#loginPanel #loginForm input {
  min-height: 44px;
  padding: .6rem .75rem;
  font-size: 16px;
}
#loginPanel #loginForm button[type="submit"] {
  min-height: 44px;
  padding: .65rem 1rem;
}
#loginPanel .login-settings {
  color: var(--muted);
  font-size: .85rem;
}
#loginPanel .login-settings summary {
  cursor: pointer;
  padding: .35rem 0;
}
#loginPanel .login-settings label {
  margin-top: .6rem;
}
#loginPanel #loginMessage:empty {
  display: none;
}


/* Actions individuelles sur tous les ingredients des repas */
.menu-requirements {
  display: grid;
  gap: 12px;
}

.menu-ingredient-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--theme-line, #dce5e8);
  overflow-wrap: anywhere;
}

.menu-ingredient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-ingredient-actions button {
  cursor: pointer;
}


/* Correction affichage complet ingredients V396 */
.menu-week-grid .menu-day-card {
  grid-template-rows: auto;
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 0;
}

.menu-week-grid .menu-meal {
  overflow: visible;
  min-height: 0;
}

.menu-week-grid .menu-requirements {
  max-height: none;
  overflow: visible;
}

/* Consolidation skipper : options article / groupe / totalité, et retour vers les achats. */
.provision-bulk-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; padding-top: .85rem; }
.provision-bulk-actions > span { flex: 1 1 18rem; color: var(--muted); font-size: .88rem; }
.provisioning-request-group-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; }
.provisioning-request-group-header h3 { margin: .5rem 0; }
.provision-consolidation-feedback { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; margin-top: .9rem; padding: .65rem .8rem; border-radius: 9px; background: var(--theme-raised, #e4f6e9); color: var(--theme-ink, #145b37); }
@media (max-width: 620px) { .provision-bulk-actions > button, .provisioning-request-group-header > button, .provision-consolidation-feedback > button { width: 100%; } }

/* Suivi visuel des catégories déjà distribuées : écran Organisation, pas le PDF. */
.purchase-category-fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.purchase-category-fieldset legend {
  margin-bottom: .55rem;
  color: var(--muted);
  font-weight: 700;
}
.purchase-category-choices {
  display: grid;
  gap: .45rem;
}
.purchase-category-choice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  cursor: pointer;
}
.purchase-category-choice:focus-within {
  outline: 2px solid var(--sp-focus, #155d74);
  outline-offset: 2px;
}
.purchase-category-choice input { width: 1rem; height: 1rem; margin: 0; flex: none; }
.purchase-category-name { flex: 1 1 9rem; font-weight: 700; }
.purchase-category-state { color: var(--muted); font-size: .83rem; font-weight: 700; }
.purchase-category-choice.is-assigned {
  background: var(--theme-raised, #e4f6e8);
  border-color: var(--theme-line, #7fbd91);
  color: var(--theme-ink, #195b35);
  cursor: not-allowed;
}
.purchase-category-choice.is-assigned .purchase-category-state { color: var(--theme-ink, #176037); }
.purchase-category-choice.is-assigned input { accent-color: #218048; }
.purchase-category-explainer { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }

/* Planning : repas deja choisi par l'equipage, en coherence avec les propositions. */
.menu-week-grid .menu-meal.is-programmed {
  border-color: var(--theme-line, #95cba6);
  background: var(--theme-raised, #e7f5eb);
}
.menu-week-grid .menu-meal.is-programmed .menu-meal-header h4 {
  color: var(--theme-ink, #155b36);
}
.menu-meal-chosen-status {
  display: inline-block;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--theme-raised, #d2ecdc);
  color: var(--theme-ink, #155b36);
  font-size: .79rem;
  line-height: 1.3;
  font-weight: 800;
}

/* SailProvision - planning compact ingredients v1 */
/* Ne plus agrandir toutes les colonnes quand des ingredients sont ajoutes. */
.menu-week-grid .menu-day-card {
  grid-template-rows: auto;
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 0;
}
.menu-week-grid .menu-ingredients-collapsible {
  width: 100%;
  min-width: 0;
  margin-top: .25rem;
}
.menu-week-grid .menu-ingredients-summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  border: 1px solid var(--theme-line, #d2e1e5);
  border-radius: .55rem;
  background: var(--theme-surface, #f1f8f9);
  color: var(--theme-ink, #17465a);
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.4;
  padding: .5rem .65rem;
  list-style: none;
}
.menu-week-grid .menu-ingredients-summary::before {
  content: "\25B8";
  font-size: 1rem;
  line-height: 1;
}
.menu-week-grid .menu-ingredients-collapsible[open] .menu-ingredients-summary::before {
  content: "\25BE";
}
.menu-week-grid .menu-ingredients-summary::-webkit-details-marker { display: none; }
.menu-week-grid .menu-ingredients-summary:hover { background: var(--theme-tint, #e6f2f5); }
.menu-week-grid .menu-ingredients-summary:focus-visible {
  outline: 3px solid var(--sp-focus, #36849c);
  outline-offset: 2px;
}
.menu-week-grid .menu-ingredients-collapsible:not([open]) > .menu-requirements {
  display: none;
}
.menu-week-grid .menu-ingredients-collapsible .menu-requirements {
  max-height: 14rem;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: .5rem;
  padding: 0 .35rem .3rem;
  overscroll-behavior: contain;
}
.menu-week-grid .menu-ingredients-collapsible .menu-ingredient-row {
  padding: .4rem 0 .5rem;
  gap: .35rem;
}
@media (max-width: 700px) {
  .menu-week-grid .menu-ingredients-collapsible .menu-requirements { max-height: 17rem; }
}

/* SailProvision - titres repas sur deux lignes v1 */
/* Reserve la meme hauteur pour chaque nom de repas, sans changer sa valeur. */
.menu-week-grid .menu-meal-header h4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
  height: 2.6em;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* SP-PLANNING-REPAS-DEUX-LIGNES-FIXE-V2 */
/* Deux lignes VISUELLES fixes : type sur une ligne, plat sur une ligne. */
.menu-week-grid .menu-meal-header h4.sp-two-line-meal-title {
  display: grid;
  grid-template-rows: 1.2em 1.35em;
  gap: .12em;
  margin: 0;
  padding: 0;
  height: 2.67em;
  min-height: 2.67em;
  max-height: 2.67em;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  line-height: normal;
}
.menu-week-grid .menu-meal-header .sp-meal-kind,
.menu-week-grid .menu-meal-header .sp-meal-name {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  -webkit-line-clamp: unset;
}
.menu-week-grid .menu-meal-header .sp-meal-kind {
  font-size: .78em;
  font-weight: 700;
  line-height: 1.5;
  color: var(--muted);
}
.menu-week-grid .menu-meal-header .sp-meal-name {
  font-size: 1em;
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
}

/* SailProvision: watch roster, scoped to the new module */
.watch-panel{max-width:1200px;margin:0 auto;padding:1rem 0 3rem}.watch-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}.watch-actions{display:flex;flex-wrap:wrap;gap:.55rem}.watch-panel button{cursor:pointer}.watch-panel button:disabled{opacity:.5;cursor:not-allowed}.watch-card{background:var(--theme-surface, var(--panel,#fff));border:1px solid var(--border,#d5e5ea);border-radius:14px;padding:1rem;margin:1rem 0}.watch-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:.7rem}.watch-grid label{display:grid;gap:.35rem;font-weight:650}.watch-grid input,.watch-grid select,.watch-grid textarea,.watch-card select,.watch-card input{width:100%;min-width:0;padding:.5rem;border:1px solid var(--theme-line, #cbdfe5);border-radius:7px;background:var(--theme-surface, #fff);color:var(--theme-ink, #143746)}.watch-table-wrap{overflow-x:auto}.watch-table{width:100%;border-collapse:collapse;min-width:690px}.watch-table th{background:var(--theme-raised, #eef7f9);text-align:left;color:var(--theme-ink, #07384f)}.watch-table td,.watch-table th{padding:.55rem;border-bottom:1px solid var(--theme-line, #d8e7eb);vertical-align:middle}.watch-table tr.is-night{background:var(--theme-raised, #f2f6fb)}.watch-table .watch-person{min-width:145px}.watch-kpi{font-weight:700;color:var(--theme-ink, #083f55)}.watch-help{font-size:.91rem;color:var(--muted,#547280)}.watch-warning{color:var(--sp-warning-ink, #965a05);font-weight:600}.watch-status{margin-top:.7rem;font-weight:650}.watch-footer-note{border-left:3px solid var(--theme-line, #168568);padding-left:.7rem}.watch-print-only{display:none}@media(max-width:700px){.watch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.watch-head{display:block}}@media print{.watch-panel .watch-actions,.watch-panel button,.watch-panel select,.watch-panel input{display:none!important}}

/* Provisioning submission deadline — SailProvision Beta 2 */
.provision-deadline-panel{padding:1rem;margin:1rem 0;background:var(--theme-surface, #eff8f9);border:1px solid var(--theme-line, #b9dade);border-radius:12px}
.provision-deadline-panel p{margin:.4rem 0;color:var(--theme-ink, #215365)}
.provision-deadline-controls{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:.7rem}
.provision-deadline-controls input{max-width:100%;min-height:42px;padding:.4rem;border:1px solid var(--theme-line, #87b9bf);border-radius:8px}

/* Beta 2 - Navigation : un seul rang, defilement horizontal si necessaire. */
.workspace > .module-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  gap: clamp(0.25rem, 0.55vw, 0.55rem);
}
.workspace > .module-nav > .module-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-inline: clamp(0.5rem, 0.8vw, 0.8rem);
  font-size: clamp(0.84rem, 1vw, 0.96rem);
}

/* Bêta 2 — informations équipage : formulaires adaptatifs. */
.crew-nationality-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.crew-nationality-field small { font-size: .8rem; color: var(--muted, #607782); }
.crew-phone-field { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.crew-phone-field select { flex: 0 1 165px; min-width: 0; }
.crew-phone-field input { flex: 1 1 160px; min-width: 0; }
.crew-document-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 540px) {
  .crew-phone-field { flex-wrap: wrap; }
  .crew-phone-field select, .crew-phone-field input { flex: 1 1 100%; }
}

/* SP-BETA-013 : fermetures midi / soir et motifs conserves */
.menu-day-closure { margin: .45rem 0 .75rem; border: 1px solid var(--theme-line, #d2e4e8); padding: .5rem; border-radius: .6rem; }
.menu-day-closure summary { cursor: pointer; font-weight: 650; }
.menu-day-closure select, .menu-day-closure input { max-width: 100%; width: 100%; margin: .4rem 0; }
.menu-day-closure-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.menu-day-closure-actions button { padding: .4rem .55rem; font-size: .85rem; }
.menu-closure-notice { font-weight: 700; color: var(--theme-ink, #9b5512); font-size: .85rem; margin: .4rem 0; }
.menu-meal.is-closed { opacity: .78; border-style: dashed; }


/* SP-BETA-011: affichage des quarts sur iPhone */
@media screen and (max-width: 700px) {

  html, body {
    max-width: 100%;
  }

  .workspace,
  .watch-panel,
  .watch-card,
  .watch-head {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .watch-panel {
    overflow-wrap: anywhere;
  }

  .watch-head {
    display: block;
  }

  .watch-head h1,
  .watch-head h2,
  .watch-head p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .watch-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .watch-table {
    min-width: 690px;
    width: max-content;
  }

  .watch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .watch-actions button {
    max-width: 100%;
  }

  .return-to-menu {
    max-width: calc(100vw - 32px);
  }
}

/* PUB-F3 : cartes de facturation alignees et responsive */
.billing-panel{display:grid;gap:1.5rem;width:100%;max-width:1120px;margin-inline:auto}
.billing-panel[hidden]{display:none}
.billing-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.billing-heading h2,.billing-heading h3{margin:.2rem 0}
.billing-offers{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:1rem;align-items:stretch}
.billing-offer,.billing-order{background:var(--theme-surface, #fff);border:1px solid var(--theme-line, #d4e4eb);border-radius:16px;padding:1.25rem;box-shadow:var(--theme-shadow, 0 3px 16px rgba(17,59,76,.04))}
.billing-offers>.billing-offer{grid-column:span 2;display:flex;flex-direction:column;align-items:stretch;gap:.85rem;min-width:0;min-height:310px}
.billing-offers>.billing-offer:nth-child(4){grid-column:2/span 2}
.billing-offers>.billing-offer:nth-child(5){grid-column:4/span 2}
.billing-offer h3,.billing-offer p{margin:0}
.billing-offer h3{line-height:1.3;min-height:2.6em;display:flex;align-items:flex-start}
.billing-offer strong{font-size:1.5rem;line-height:1.25;color:var(--theme-ink, #123849);display:block;min-height:1.6em;font-variant-numeric:tabular-nums}
.billing-offer p{line-height:1.5;flex:1 1 auto}
.billing-offer label{font-weight:600;color:var(--theme-ink, #536f7c);margin-bottom:-.45rem}
.billing-offer input{box-sizing:border-box;width:140px;max-width:100%;padding:.6rem;border:1px solid var(--theme-line, #b8d4de);border-radius:9px}
.billing-offer button[data-billing-buy]{margin-top:auto;align-self:flex-start;min-height:44px;max-width:100%;white-space:normal;text-align:center}
.billing-order{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.7rem}
.billing-order p{margin:.4rem 0 0;color:var(--theme-ink, #536f7c)}
.billing-gift-options{border:1px solid var(--theme-line, #d4e4eb);border-radius:16px;padding:1rem 1.25rem;margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:.6rem;background:var(--theme-surface, #f7fbfd);min-width:0}
.billing-gift-options legend{font-weight:700;color:var(--theme-ink, #123849);padding:0 .4rem}
.billing-gift-options select,.billing-gift-options input{box-sizing:border-box;max-width:100%;width:min(420px,100%);padding:.65rem;border:1px solid var(--theme-line, #b8d4de);border-radius:9px;background:var(--theme-surface, #fff)}
.billing-gift-options p{margin:0;color:var(--theme-ink, #476574);font-size:.9rem}
.billing-gift-options [hidden]{display:none}
@media(max-width:800px){
 .billing-offers{grid-template-columns:repeat(2,minmax(0,1fr))}
 .billing-offers>.billing-offer,.billing-offers>.billing-offer:nth-child(4),.billing-offers>.billing-offer:nth-child(5){grid-column:auto;min-height:300px}
 .billing-offers>.billing-offer:nth-child(5){grid-column:1/-1;max-width:calc(50% - .5rem);width:100%;justify-self:center;box-sizing:border-box}
}
@media(max-width:540px){
 .billing-offers{grid-template-columns:minmax(0,1fr)}
 .billing-offers>.billing-offer,.billing-offers>.billing-offer:nth-child(5){grid-column:1;max-width:none;min-height:0}
 .billing-offer h3{min-height:0}
 .billing-order{align-items:flex-start;flex-direction:column}
 .billing-panel{gap:1.2rem}

}

/* B3-002 : actions de saisie successive des ingrédients */
#menuRequirementFormDialog #menuRequirementForm > button[type="submit"] {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  background: var(--theme-emphasis, #0b3b53);
  color: var(--theme-ink, #fff);
  border-radius: 12px;
}

#menuRequirementFormDialog > button[data-close-menu-dialog] {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
  border-radius: 12px;
}
#menuRequirementExistingList {
  display: grid;
  gap: .5rem;
  margin-bottom: 1rem;
}
#menuRequirementExistingList .menu-existing-item {
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

/* B3-002 : fenetre ingredients plus lisible */
#menuRequirementFormDialog {
  width: min(94vw, 760px);
  max-height: 92dvh;
  overflow-y: auto;
}

#menuRequirementExistingList {
  max-height: 230px;
  overflow-y: auto;
  padding: 0.75rem;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

#menuRequirementExistingList h4 {
  position: sticky;
  top: -0.75rem;
  z-index: 1;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0;
  background: var(--panel);
}

#menuRequirementExistingList .menu-existing-item {
  padding: 0.5rem 0.7rem;
  margin: 0;
  border-radius: 8px;
}

#menuRequirementExistingList .menu-existing-item + .menu-existing-item {
  margin-top: 0.35rem;
}
/* B3-002 : ingrédients et actions dans la fenêtre */
#menuRequirementExistingList .menu-existing-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

#menuRequirementExistingList .menu-existing-item > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

#menuRequirementExistingList .menu-existing-item > button:first-of-type {
  margin-left: auto;
}

#menuRequirementExistingList .menu-existing-item > button {
  flex: 0 0 auto;
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 720px) {
  #menuRequirementExistingList .menu-existing-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #menuRequirementExistingList .menu-existing-item > span {
    flex: 1 1 100%;
  }

  #menuRequirementExistingList .menu-existing-item > button:first-of-type {
    margin-left: 0;
  }
}
\n


/* B3-010 - Catalogue personnel du skipper */
.skipper-personal-catalog {
  margin-top: 20px;
  padding: 22px;
  background: var(--theme-surface, #f8fbfc);
  border: 1px solid var(--theme-line, #d9e9ed);
  border-radius: 18px;
}

.skipper-personal-catalog[hidden] {
  display: none !important;
}

.skipper-personal-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.skipper-personal-catalog-header h4 {
  margin: 0 0 6px;
  color: var(--theme-ink, #07364a);
  font-size: 1.15rem;
}

.skipper-personal-catalog-header p {
  margin: 0;
  color: var(--theme-ink, #55717e);
}

.skipper-personal-catalog-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.skipper-personal-catalog-toolbar label {
  font-weight: 600;
  color: var(--theme-ink, #12384a);
}

#skipperCatalogSearch {
  width: 100%;
  padding: 12px 14px;
  background: var(--theme-raised, white);
  border: 1px solid var(--theme-line, #cbdfe5);
  border-radius: 12px;
  color: var(--theme-ink, #12384a);
}

#skipperCatalogSearch:focus-visible {
  outline: 2px solid var(--sp-focus, #087a80);
  outline-offset: 2px;
}

#skipperCatalogMessage {
  color: var(--theme-ink, #55717e);
  margin-bottom: 12px;
}

.skipper-personal-catalog-list {
  display: grid;
  gap: 10px;
}

.skipper-catalog-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--theme-raised, white);
  border: 1px solid var(--theme-line, #e0ecef);
  border-radius: 12px;
}

.skipper-catalog-product-name {
  font-weight: 600;
  color: var(--theme-ink, #07364a);
}

.skipper-catalog-product-meta {
  font-size: 0.85rem;
  color: var(--theme-muted, #66808b);
}

.skipper-catalog-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 700px) {
  .skipper-personal-catalog {
    padding: 15px;
  }

  .skipper-personal-catalog-header,
  .skipper-catalog-product {
    align-items: stretch;
    flex-direction: column;
  }

  .skipper-catalog-product-actions {
    width: 100%;
  }
}


/* B3-010 - Navigation par categories */
.skipper-catalog-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.skipper-catalog-categories .skipper-catalog-category-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--theme-line, #cbdfe5);
  border-radius: 16px;
  background: var(--theme-surface, #f0f8fa);
  color: var(--theme-ink, #103e52);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.skipper-catalog-category-button strong {
  font-size: 1.1rem;
}

.skipper-catalog-category-button span {
  color: var(--theme-ink, #607d89);
}

.skipper-catalog-categories
.skipper-catalog-secondary-category {
  background: var(--theme-surface, #fff);
}

#skipperCatalogBack {
  margin-bottom: 18px;
}

.skipper-personal-catalog-toolbar[hidden] {
  display: none !important;
}

@media (max-width: 650px) {
  .skipper-catalog-categories {
    grid-template-columns: 1fr;
  }
}


/* B3-010 - Formulaire produits personnels */
.skipper-catalog-editor {
  display: grid;
  gap: 12px;
  padding: 22px;
  margin: 18px 0;
  background: var(--theme-surface, #f5fafb);
  border: 1px solid var(--theme-line, #cbdfe5);
  border-radius: 16px;
}

.skipper-catalog-editor[hidden] {
  display: none !important;
}

.skipper-catalog-editor h5 {
  margin: 0 0 8px;
  color: var(--theme-ink, #103e52);
  font-size: 1.15rem;
}

.skipper-catalog-editor label {
  color: var(--theme-ink, #103e52);
  font-weight: 600;
}

.skipper-catalog-editor input,
.skipper-catalog-editor select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--theme-line, #cbdfe5);
  border-radius: 10px;
  font: inherit;
}

.skipper-catalog-editor .skipper-catalog-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* B3-010 - Couleurs des statuts */
.skipper-catalog-status-active {
  color: var(--theme-ink, #18723c);
  font-weight: 700;
}

.skipper-catalog-status-excluded {
  color: var(--theme-ink, #bd3030);
  font-weight: 700;
}

/* B3-010 - Boutons harmonises */
.skipper-catalog-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
}
.skipper-catalog-product > div:first-child {
  flex: 1 1 200px;
  min-width: 0;
}
.skipper-catalog-product .skipper-catalog-product-actions {
  display: grid;
  grid-template-columns: repeat(2, 130px);
  gap: 10px;
  width: 270px;
  flex: 0 0 270px;
  justify-content: end;
  align-items: center;
}
.skipper-catalog-product .skipper-catalog-product-actions > button {
  box-sizing: border-box;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  height: 42px;
  min-height: var(--sp-control-height, 44px);
  margin: 0;
  padding: 8px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .skipper-catalog-product .skipper-catalog-product-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    flex: 1 1 100%;
  }
  .skipper-catalog-product .skipper-catalog-product-actions > button {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* B3-010 - Centre de mises a jour */
.skipper-catalog-updates {
  margin: 16px 0;
  padding: 18px;
  background: var(--theme-surface, #f3f9fb);
  border: 1px solid var(--theme-line, #cbdfe5);
  border-radius: 16px;
}

.skipper-catalog-updates[hidden] {
  display: none !important;
}

.skipper-catalog-updates-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skipper-catalog-updates h5 {
  margin: 0;
  color: var(--theme-ink, #07364a);
  font-size: 1.1rem;
}

.skipper-catalog-updates p {
  margin: 8px 0 12px;
  color: var(--theme-ink, #587481);
}

.skipper-catalog-updates-heading span,
.skipper-catalog-update-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--theme-raised, #fce9cc);
  color: var(--theme-ink, #81500b);
  font-size: 12px;
  font-weight: 700;
}

.skipper-catalog-update-badge {
  margin-left: 7px;
}

.skipper-catalog-update-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--theme-line, #d9e9ed);
}

.skipper-catalog-update-entry > div {
  display: grid;
  gap: 4px;
  flex: 1 1 220px;
}

.skipper-catalog-update-entry strong {
  color: var(--theme-ink, #07364a);
}

.skipper-catalog-update-entry small {
  color: var(--theme-muted, #607785);
}

.skipper-catalog-update-entry button {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
}

/* B3-010 - Statuts des mises a jour */
.skipper-catalog-update-current {
  background: var(--theme-raised, #e5f5ea) !important;
  color: var(--theme-ink, #18723c) !important;
}
.skipper-catalog-update-current-text {
  color: var(--theme-ink, #18723c) !important;
  font-weight: 600;
}
.skipper-catalog-update-error {
  background: var(--sp-error-bg, #fff0df) !important;
  color: var(--sp-error-ink, #925200) !important;
}
.skipper-catalog-update-error-text {
  color: var(--sp-error-ink, #925200) !important;
  font-weight: 600;
}


/* Statuts des factures SailProvision */
.billing-status {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  background: var(--theme-raised, #e8eef2);
  color: var(--theme-ink, #36546a);
}

.billing-status-0 {
  background: var(--theme-raised, #fff0d6);
  color: var(--theme-ink, #925600);
}

.billing-status-1 {
  background: var(--theme-raised, #dff5e8);
  color: var(--theme-ink, #17633b);
}

.billing-status-2 {
  background: var(--theme-raised, #fde6e6);
  color: var(--theme-ink, #a12626);
}

.billing-status-3 {
  background: var(--theme-raised, #e4edf5);
  color: var(--theme-ink, #315b79);
}

/* B3-014 : accordéon des invitations */
.crew-invitation-summary {
  margin-top: .8rem;
  padding: 1rem;
  border: 1px solid var(--theme-line, #d5e5ea);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
}
.crew-invitation-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .8rem;
}
.crew-invitation-heading p { margin: .3rem 0; }
.crew-invitation-status {
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--theme-raised, #eaf2f5);
  color: var(--theme-ink, #315a69);
  font-size: .9rem;
  font-weight: 700;
}
.crew-invitation-status[data-status="Accepted"] {
  background: var(--sp-success-bg, #e3f3ea);
  color: var(--sp-success-ink, #176344);
}
.crew-invitation-status[data-status="Pending"] {
  background: var(--sp-pending-bg, #fff3d9);
  color: var(--sp-pending-ink, #805500);
}
.crew-invitation-history {
  margin-top: .9rem;
  border-top: 1px solid var(--theme-line, #dce7eb);
  padding-top: .8rem;
}
.crew-invitation-history summary {
  cursor: pointer;
  color: var(--theme-ink, #087c9b);
  font-weight: 700;
}
.crew-invitation-history-list { margin-top: .7rem; }
.crew-invitation-history-entry {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--theme-line, #edf2f4);
}
.crew-invitation-history-entry span {
  color: var(--theme-ink, #617985);
}

/* B3-014 : finition visuelle du suivi des invitations */
#crewInvitationTrackingList .crew-invitation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#crewInvitationTrackingList .crew-invitation-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 700;
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Accepted"] {
  background: var(--sp-success-bg, #e1f4e9);
  color: var(--sp-success-ink, #176344);
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Pending"] {
  background: var(--sp-pending-bg, #fff1d6);
  color: var(--sp-pending-ink, #815500);
}

#crewInvitationTrackingList .crew-invitation-history {
  display: block;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--theme-line, #dce7eb);
}

#crewInvitationTrackingList .crew-invitation-history summary {
  cursor: pointer;
  color: var(--theme-ink, #087c9b);
  font-weight: 700;
  padding: .35rem 0;
}

#crewInvitationTrackingList .crew-invitation-history-list {
  display: grid;
  gap: .4rem;
  margin-top: .75rem;
}

#crewInvitationTrackingList .crew-invitation-history-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding: .65rem .8rem;
  background: var(--theme-surface, #f6fafb);
  border: 1px solid var(--theme-line, #e2edf0);
  border-radius: 8px;
}

#crewInvitationTrackingList .crew-invitation-history-entry span {
  color: var(--theme-ink, #617985);
  font-size: .9rem;
}

@media (max-width: 560px) {
  #crewInvitationTrackingList .crew-invitation-history-entry {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* B3-014 : historique des invitations, statut et date alignes */
#crewInvitationTrackingList .crew-invitation-history-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#crewInvitationTrackingList .crew-invitation-history-entry {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  padding: 0.75rem 1rem;
  background: var(--theme-surface, #f6fafb);
  border: 1px solid var(--theme-line, #dce7eb);
  border-radius: 10px;
}

#crewInvitationTrackingList .crew-invitation-history-entry strong {
  display: block;
  min-width: 0;
  color: var(--theme-ink, #103745);
}

#crewInvitationTrackingList .crew-invitation-history-entry span {
  display: block;
  color: var(--theme-ink, #617985);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 560px) {
  #crewInvitationTrackingList .crew-invitation-history-entry {
    grid-template-columns: 1fr;
  }

  #crewInvitationTrackingList .crew-invitation-history-entry span {
    text-align: left;
  }
}


/* B3-015 — Statuts des invitations skipper et historique */
.crew-invitation-status[data-status="Accepted"] {
  color: var(--sp-success-ink, #166534);
  background-color: var(--sp-success-bg, #dcfce7);
}

.crew-invitation-status[data-status="Pending"] {
  color: var(--sp-pending-ink, #9a3412);
  background-color: var(--sp-pending-bg, #ffedd5);
}

.crew-invitation-status[data-status="Declined"] {
  color: var(--sp-error-ink, #991b1b);
  background-color: var(--sp-error-bg, #fee2e2);
}

.crew-invitation-status[data-status="Revoked"],
.crew-invitation-status[data-status="Expired"] {
  color: var(--sp-disabled-ink, #475569);
  background-color: var(--sp-disabled-bg, #e2e8f0);
}

.crew-invitation-smtp-error {
  color: var(--sp-error-ink, #b91c1c);
  font-weight: 600;
}



/* B3-015 — Finition visuelle invitations */
#crewInvitationTrackingList .crew-invitation-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 700;
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Accepted"] {
  color: var(--sp-success-ink, #166534);
  background: var(--sp-success-bg, #dcfce7);
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Pending"] {
  color: var(--sp-pending-ink, #9a3412);
  background: var(--sp-pending-bg, #ffedd5);
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Declined"] {
  color: var(--sp-error-ink, #991b1b);
  background: var(--sp-error-bg, #fee2e2);
}

#crewInvitationTrackingList .crew-invitation-status[data-status="Revoked"],
#crewInvitationTrackingList .crew-invitation-status[data-status="Expired"] {
  color: var(--sp-disabled-ink, #475569);
  background: var(--sp-disabled-bg, #e2e8f0);
}

/* Conserver les couleurs des badges dans l'historique */
#crewInvitationTrackingList
.crew-invitation-history-entry .crew-invitation-status {
  display: inline-flex;
  width: fit-content;
  text-align: left;
  white-space: normal;
}

/* Boutons de renvoi */
#crewInvitationTrackingList
.crew-invitation-summary > button.secondary {
  background: var(--theme-emphasis, #083d56);
  color: var(--theme-ink, #ffffff);
  border: 1px solid var(--theme-line, #083d56);
  cursor: pointer;
}

#crewInvitationTrackingList
.crew-invitation-summary > button.secondary:hover {
  background: var(--theme-emphasis, #075b78);
  border-color: var(--theme-line, #075b78);
}

#crewInvitationTrackingList .crew-invitation-smtp-error {
  color: var(--sp-error-ink, #b91c1c);
  font-weight: 700;
}

/* B3-016 — Consultation des croisières archivées */
.archive-cruise-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #d5e4e9);
  border-radius: 14px;
}

.archive-cruise-card h3 {
  color: var(--theme-ink, #173d50);
  margin-top: 0;
}

.archive-cruise-card button {
  margin-top: .75rem;
}

.archive-cruise-details {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--theme-raised, #f0f7fa);
  border: 1px solid var(--theme-line, #d5e4e9);
}

.archive-cruise-details h4 {
  color: var(--theme-ink, #176477);
  margin-top: 0;
}


/* SailProvision V4.3 - Accueil epure (sans supprimer les fonctionnalites existantes). */
.home-panel .home-compact-actions,
.home-panel .home-compact-priorities {
  padding: 18px 20px;
  border: 1px solid var(--theme-line, #d9e7eb);
  border-radius: 15px;
  background: var(--theme-surface, #f8fbfc);
}
.home-panel .home-compact-actions h3,
.home-panel .home-compact-priorities h3 { margin: 0 0 13px; color: var(--theme-ink, #103d53); font-size: 18px; }
.home-panel .home-compact-links { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.home-panel .home-compact-links button {
  display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:5px;
  min-height:76px; padding:13px; border:1px solid var(--theme-line, #d8e7ea); border-radius:12px;
  background:var(--theme-raised, white); color:var(--theme-link, #103d53); text-align:left; cursor:pointer;
}
.home-panel .home-compact-links button:hover,
.home-panel .home-compact-links button:focus-visible { border-color:var(--theme-line, #0f657b); background:var(--theme-tint, #eef7f9); }
.home-panel .home-compact-links button span { font-weight:750; font-size:14px; }
.home-panel .home-compact-links button small { color:var(--theme-link, #5a7180); font-size:12px; }
.home-panel .home-compact-priority-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.home-panel .home-compact-priority-heading h3 { margin:0; }
.home-panel #homeCompactPriorityBadge { background:var(--theme-raised, #fff0ef); color:var(--theme-ink, #a32020); border-radius:99px; padding:5px 10px; font-weight:700; font-size:12px; }
.home-panel #homeCompactDocumentSummary { margin:12px 0 7px; color:var(--theme-ink, #17334b); }
.home-panel #homeCompactSkipperSummary { margin:5px 0 10px; color:var(--theme-ink, #506b7a); }
.home-panel #homeCompactDocumentLink { margin-top:8px; }
.home-panel .home-compact-cruise-summary { color:var(--theme-ink, #456475); font-size:14px; margin:10px 0 0; }
.home-panel .home-compact-map-details { margin-top:12px; }
.home-panel .home-compact-map-details > summary { font-weight:650; font-size:13px; color:var(--theme-ink, #0b5872); cursor:pointer; }
.home-panel .home-compact-map-details[open] > summary { margin-bottom:14px; }
.home-panel .home-compact-extras { border:1px solid var(--theme-line, #d9e7eb); border-radius:14px; padding:14px 16px; background:var(--theme-surface, #fff); }
.home-panel .home-compact-extras > summary { color:var(--theme-ink, #103d53); font-weight:700; cursor:pointer; }
.home-panel .home-compact-extras-content { display:grid; gap:18px; padding-top:14px; }
/* Closed details must not be overridden by the author grid display rule. */
.home-panel details.home-compact-extras:not([open]) > .home-compact-extras-content { display:none !important; }
.home-panel #homeBoardDocuments,
.home-panel #homeBoardReadingFollowup { display:none !important; }
@media(max-width:760px) { .home-panel .home-compact-links { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .home-panel .home-compact-links { grid-template-columns:1fr; } }

/* V4.3 accueil compact: map visible, concise links, no duplicate document details. */
.home-panel #homeCruiseMap:not([hidden]) { display:block; margin-top:14px; }
.home-panel #homeBoardDocuments, .home-panel #homeBoardReadingFollowup { display:none !important; }
.home-panel .home-compact-links button { appearance:none; border-radius:12px; background:var(--theme-surface, #fff); color:var(--theme-link, #103d53); }
.home-panel .home-compact-map-details { margin-top:10px; }

/* V4.3 accueil - navigation unique et occupation d'espace reduite. */
.home-panel.home-has-active-cruise #skipperCruiseHome { display:none !important; }
.home-panel .home-compact-priorities { padding:14px 16px; }
.home-panel .home-compact-priorities h3 { margin:0 0 4px; }
.home-panel #homeCompactDocumentSummary { margin:5px 0; }
.home-panel #homeCompactSkipperSummary { margin:2px 0 5px; }
.home-panel #homeCompactDocumentLink { margin-top:4px; }
.home-panel .home-compact-extras { padding:10px 14px; }
.home-panel .home-compact-extras-content { padding-top:12px; }
.home-panel .home-cruise-map iframe { height:260px; }
@media (max-width:760px) { .home-panel .home-cruise-map iframe { height:220px; } }

/* V4.3 accueil : les cartes de modules doublonnent la navigation principale. */
#homePanel #homeModulesTitle,
#homePanel #homeModulesGrid { display:none !important; }
