/* ma-copro v1.1 - style inspiré de la maquette */
:root {
	--bg: #f4f7fc;
	--card: #ffffff;
	--ink: #13204a;
	--muted: #66708c;
	--line: #e6ebf4;
	--blue: #2f6fe4;
	--blue-2: #1d56c9;
	--green: #1f9d55;
	--green-bg: #e6f6ec;
	--warn: #e8890c;
	--bad: #e0393e;
	--radius: 16px;
	--shadow: 0 1px 2px rgba(19, 32, 74, .05), 0 8px 24px rgba(19, 32, 74, .06);
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ en-tête */
.top {
	position: relative;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 14px 24px;
	min-height: 132px;
	background: linear-gradient(90deg, #fff 0%, #f6f9ff 40%, #eaf2ff 100%);
	overflow: hidden;
}
.top > *:not(.banner) { position: relative; z-index: 1; }
.banner {
	position: absolute;
	inset: 0 0 0 42%;
	background-size: cover;
	background-position: center 55%;
	opacity: 0;
	transition: opacity .6s;
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
}
.banner.on { opacity: 1; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.brand h1 { font-size: 40px; letter-spacing: -.03em; line-height: 1; }
.brand p { font-size: 17px; margin-top: 6px; }
.tagline {
	font-family: "Segoe Script", "Brush Script MT", "Comic Sans MS", cursive;
	color: #1f3f8f;
	font-size: 26px;
	transform: rotate(-8deg);
	line-height: 1.15;
	max-width: 280px;
	border-bottom: 3px solid #4f8cf5;
	border-radius: 0 0 60% 10%;
	padding-bottom: 4px;
}
.top-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.top-right .city { font-weight: 700; color: #1d3f9a; font-size: 16px; text-shadow: 0 0 6px #fff, 0 0 12px #fff; }
.top-right .date { text-transform: capitalize; text-shadow: 0 0 6px #fff, 0 0 12px #fff; }
.top-right .time { display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; text-shadow: 0 0 6px #fff, 0 0 12px #fff; }
.btn-light {
	display: inline-flex; align-items: center; gap: 8px;
	background: #fff; color: var(--ink); border: 1px solid var(--line);
	border-radius: 12px; padding: 9px 14px; font-weight: 600; box-shadow: var(--shadow); margin-top: 6px;
}
.credit { position: absolute !important; right: 230px; bottom: 6px; font-size: 10px; color: #fff; background: rgba(19, 32, 74, .55); padding: 2px 8px; border-radius: 6px; }
.credit:empty { display: none; }

/* ------------------------------------------------------------ mise en page */
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 132px); }
.side { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: #f8fafe; }
.side a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; color: var(--ink); font-weight: 550; font-size: 15.5px; }
.side a:hover { background: #eaf1ff; }
.side a.on { background: linear-gradient(135deg, #3b82f6, var(--blue-2)); color: #fff; box-shadow: 0 6px 16px rgba(47, 111, 228, .3); }
.side-foot { margin-top: auto; text-align: center; padding: 18px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.side-foot small { color: var(--muted); font-size: 11.5px; }
.content { padding: 18px 22px 24px; min-width: 0; }

/* ------------------------------------------------------------ bonjour */
.hello { display: grid; grid-template-columns: 1fr minmax(0, 520px) 1fr; gap: 20px; align-items: center; margin-bottom: 18px; }
.hello h2 { font-size: 38px; letter-spacing: -.03em; }
.hello p { font-size: 16px; color: #2b3a66; }
.addr-box { display: flex; align-items: center; gap: 16px; background: var(--green-bg); border-radius: 14px; padding: 12px 18px; color: var(--ink); }
.addr-box .pin { width: 34px; height: 34px; fill: var(--green); flex: none; }
.addr-box b { display: block; }
.addr-box small { color: var(--muted); }
.addr-box div { flex: 1; min-width: 0; }
.help { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.quote { margin: 0; text-align: right; font-style: italic; color: #2b4a9a; font-size: 16px; }
.quote:not(:empty)::before { content: "\""; }
.quote:not(:empty)::after { content: "\""; }

/* ------------------------------------------------------------ cartes */
.dash { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.dash .c-weather { grid-column: span 3; }
.dash .c-transit { grid-column: span 6; }
.dash .c-map { grid-column: span 3; }
.dash > .card:nth-child(n+4) { grid-column: span 3; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; }
.card-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.card-h h3 { font-size: 17px; font-weight: 700; }
.card-h p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ci { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.ci.blue { background: #eaf1ff; } .ci.green { background: #e6f6ec; } .ci.red { background: #fdeceb; }
.expand { margin-left: auto; border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); font-size: 16px; }
.body { flex: 1; min-width: 0; }
.more { margin-top: 12px; text-align: right; font-size: 13.5px; font-weight: 550; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-size: 13px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.skeleton { height: 120px; border-radius: 12px; background: linear-gradient(90deg, #eef2f8 0%, #f8fafd 50%, #eef2f8 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ météo */
.w-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.w-temp { font-size: 54px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.w-desc { font-size: 17px; margin-top: 6px; }
.w-today { font-size: 13.5px; display: grid; gap: 5px; }
.w-today .t { color: var(--muted); }
.up { color: var(--bad); } .down { color: var(--blue); }
.w-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.w-day { background: #f5f8fd; border-radius: 12px; text-align: center; padding: 8px 4px; font-size: 13px; }
.w-day .i { font-size: 22px; display: block; margin: 4px 0; }
.w-day b { font-size: 15px; display: block; }
.w-day small { color: var(--muted); }
.w-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.w-h { text-align: center; font-size: 12px; color: var(--muted); }
.w-h b { display: block; color: var(--ink); font-size: 14px; }
.w-h .i { font-size: 20px; display: block; margin: 2px 0; }
.rain { height: 30px; display: flex; align-items: flex-end; justify-content: center; }
.rain i { width: 10px; border-radius: 4px 4px 2px 2px; background: #8fb4ff; display: block; }
.w-week { display: grid; gap: 6px; margin-top: 16px; }
.w-row { display: grid; grid-template-columns: 110px 34px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; background: #f5f8fd; border-radius: 10px; font-size: 13.5px; }
.w-row .n { text-transform: capitalize; font-weight: 600; }
.w-row .i { font-size: 22px; }
.w-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 12px 0; }

/* ------------------------------------------------------------ transports */
.tr-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.tr-h h4 { font-size: 15px; }
.tr-h h4 small { font-weight: 400; color: var(--muted); font-size: 13px; }
.mode-pill { font-size: 12px; color: var(--blue); display: inline-flex; gap: 4px; align-items: center; }
.mode-pill.night { color: #5b3fc4; }
.tr-row { display: grid; grid-template-columns: auto minmax(90px, 1fr) repeat(2, minmax(104px, auto)); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tr-row:first-of-type { border-top: 0; }
.tr-name { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-name small { display: block; color: var(--warn); font-weight: 500; font-size: 11.5px; white-space: normal; }
.tr-dist { display: block; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.sense { display: grid; gap: 3px; justify-items: center; }
.sense .to { font-size: 11.5px; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.sense .to::before { content: "→ "; }
.times { display: flex; gap: 4px; }
.t { min-width: 50px; text-align: center; background: var(--green-bg); color: #0f5132; border-radius: 8px; padding: 3px 6px; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.t small { font-weight: 500; font-size: 10.5px; }
.t.th { background: #f1f4f9; color: var(--ink); }
.t.none { background: none; color: var(--muted); font-weight: 400; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; font-size: 13px; }
.badge .m { font-size: 9.5px; font-weight: 800; border: 1.5px solid var(--ink); border-radius: 5px; padding: 2px 3px; line-height: 1; }
.badge .m.mm { border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.badge .c { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; }
.badge .c.round { border-radius: 50%; min-width: 26px; padding: 0; }
.fallback { font-size: 12px; color: var(--warn); margin-bottom: 6px; }
.tr-sep { height: 14px; }

/* ------------------------------------------------------------ plan */
.map { position: relative; flex: 1; min-height: 300px; border-radius: 12px; overflow: hidden; background: #eef1f5; }
.map-big { min-height: 520px; }
.map .tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map svg.ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mk { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mk .lbl { background: #fff; border-radius: 6px; padding: 2px 6px; font-size: 11.5px; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); line-height: 1.2; }
.mk.home { transform: translate(-50%, -100%); }
.mk.home svg { width: 34px; height: 42px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.mk .pt { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.mk .bus { background: #fff; border: 1.5px solid var(--ink); border-radius: 5px; font-size: 8.5px; font-weight: 800; padding: 1px 3px; }
.mk .code { border-radius: 6px; padding: 1px 6px; font-weight: 800; font-size: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.scale { position: absolute; right: 12px; bottom: 18px; font-size: 11px; text-align: center; }
.scale i { display: block; height: 6px; border: 2px solid var(--ink); border-top: 0; margin-top: 1px; }
.attr { position: absolute; left: 6px; bottom: 4px; font-size: 9.5px; background: rgba(255, 255, 255, .8); padding: 1px 5px; border-radius: 4px; }

/* ------------------------------------------------------------ air */
.air-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.air-badge { background: var(--green-bg); border-radius: 14px; padding: 6px 14px; text-align: center; }
.air-badge small { display: block; font-size: 12px; font-weight: 600; }
.air-badge b { font-size: 24px; }
.gauge { position: relative; height: 12px; border-radius: 8px; margin: 22px 0 10px; background: linear-gradient(90deg, #50c878 0 20%, #a6d96a 20% 40%, #ffd43b 40% 60%, #fd7e14 60% 80%, #e03131 80% 100%); }
.gauge i { position: absolute; top: -12px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid var(--ink); transform: translateX(-50%); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: #f1f4f9; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }

/* ------------------------------------------------------------ eaux */
.hy-level { display: flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 750; margin-top: 6px; }
.hy-trend { color: var(--muted); font-size: 13px; }
.spark { width: 100%; height: 60px; margin-top: 10px; display: block; }

/* ------------------------------------------------------------ environnement / vie pratique */
.poi { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.poi .pi { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.poi b { display: block; font-size: 14px; }
.poi small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poi .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.poi > div { min-width: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.list li:first-child { border-top: 0; }
.list li small { color: var(--muted); display: block; }
.list .d { color: var(--muted); white-space: nowrap; }
.cat-h { font-size: 14.5px; margin: 14px 0 4px; display: flex; gap: 8px; align-items: center; }
.cat-h:first-child { margin-top: 0; }

/* ------------------------------------------------------------ pages détaillées */
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prose h4 { margin: 14px 0 6px; }
.prose ul { margin: 0; padding-left: 18px; }
.prose li { margin: 4px 0; }

/* ------------------------------------------------------------ paramètres */
.field { display: flex; gap: 8px; }
.field input, .prefs input {
	border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; background: #fbfcfe;
}
.field input { flex: 1; min-width: 0; }
.field input:focus, .prefs input:focus { border-color: var(--blue); background: #fff; }
.btn { border: 0; border-radius: 10px; padding: 10px 18px; background: linear-gradient(135deg, #3b82f6, var(--blue-2)); color: #fff; font-weight: 650; }
.suggest { list-style: none; margin: 8px 0 0; padding: 0; }
.suggest li { padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.suggest li small { color: var(--muted); display: block; font-size: 12px; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: #eef3fc; }
.prefs { display: grid; gap: 10px; }
.prefs label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.prefs label span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.prefs input { width: 100px; text-align: right; }
.prefs-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.prefs-actions .btn-light { margin: 0; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; }
.link:hover { color: var(--bad); }

/* ------------------------------------------------------------ le saviez-vous */
.tip { display: flex; align-items: center; gap: 16px; background: #eaf2ff; border-radius: var(--radius); padding: 14px 22px; margin-top: 18px; }
.tip-i { font-size: 30px; }
.tip b { font-size: 16px; }
.tip p { font-size: 13.5px; color: #2b3a66; margin-top: 2px; }
.tip div { flex: 1; }
.tip a { font-weight: 650; white-space: nowrap; }
.foot { font-size: 11.5px; color: var(--muted); margin-top: 8px; text-align: right; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1400px) {
	.dash .c-weather { grid-column: span 5; }
	.dash .c-transit { grid-column: span 7; }
	.dash .c-map { grid-column: span 12; }
	.dash .c-map .map { min-height: 340px; }
	.dash > .card:nth-child(n+4) { grid-column: span 6; }
	.tagline { display: none; }
}
@media (max-width: 1100px) {
	.dash > .card { grid-column: span 12 !important; }
	.cols, .cols3 { grid-template-columns: 1fr; }
	.hello { grid-template-columns: 1fr; }
	.quote { display: none; }
}
@media (max-width: 760px) {
	.top { min-height: 96px; padding: 10px 14px; gap: 10px; }
	.brand img { width: 52px; height: 40px; }
	.brand h1 { font-size: 24px; }
	.brand p { display: none; }
	.top-right .btn-light, .top-right .city { display: none; }
	.credit { right: 8px; }
	.layout { grid-template-columns: 1fr; padding-bottom: 70px; }
	/* Menu en barre d'icônes en bas de l'écran */
	.side {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
		flex-direction: row; justify-content: space-around; gap: 0;
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
		border-right: 0; border-top: 1px solid var(--line); background: #fff;
	}
	.side a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; flex: 1; text-align: center; border-radius: 10px; }
	.side a .ico { width: 22px; height: 22px; }
	.side-foot { display: none; }
	.content { padding: 12px; }
	.hello h2 { font-size: 26px; }
	.hello { gap: 10px; margin-bottom: 12px; }
	.tr-row { grid-template-columns: auto minmax(0, 1fr) repeat(2, auto); gap: 6px; }
	.sense .to { max-width: 90px; }
	.t { min-width: 42px; font-size: 12.5px; }
	.tip { flex-wrap: wrap; }
	.w-row { grid-template-columns: 80px 30px 1fr auto; }
	.w-row .x { display: none; }
}
