:root{
  --yellow:#f7b900;
  --yellow-2:#ffc83d;
  --cream:#fff9e8;
  --ink:#252525;
  --muted:#777;
  --line:#eee1bf;
  --card:#fffefa;
  --shadow:0 14px 32px rgba(34,28,18,.08);
}
*{box-sizing:border-box}
html,body{width:100%;min-height:100%;margin:0}
body{
  background:#fff;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Noto Sans JP",sans-serif;
  color:var(--ink);
}
.app{
  position:relative;
  width:100%;
  max-width:430px;
  min-height:100dvh;
  margin:0 auto;
  overflow:hidden;
  background:#fff;
  padding-top:env(safe-area-inset-top);
}
.app-header{
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 20px 8px;
}
.logo-img{
  width:235px;
  height:56px;
  object-fit:contain;
  object-position:left center;
}
.icon-button{
  width:42px;height:42px;border-radius:50%;border:1px solid #e7e7e7;background:white;
  box-shadow:0 6px 16px rgba(0,0,0,.07);
  display:grid;place-items:center;
}
.icon-button img{width:25px;height:25px;object-fit:contain}
.screen{
  display:none;
  height:calc(100dvh - 76px - 82px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow:auto;
  padding:0 18px 18px;
}
.screen.active{display:block}
.top-cards{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
  margin-top:0;
}
.mini-card{
  min-height:96px;
  padding:10px 10px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.mini-card:first-child{border-radius:16px 0 0 16px}
.mini-card:nth-child(2){border-radius:0 16px 16px 0}
.label{font-size:10px;color:#666;text-align:center;margin-bottom:4px}
.weather-row,.steps-row{display:flex;align-items:center;justify-content:center;gap:9px}
.weather-icon{width:46px;height:46px;object-fit:contain}
.steps-icon{width:48px;height:48px;object-fit:contain}
.date{font-size:13px}
.mini-card strong{font-size:19px}
.steps-row strong{font-size:27px}.steps-row small{font-size:13px;margin-left:2px}
.greeting-card{
  margin:30px 20px 0;
  min-height:98px;
  display:grid;place-items:center;
  border-radius:16px;
  border:1.4px solid #f4d07b;
  background:#fffdf8;
  box-shadow:var(--shadow);
}
.greeting-card p{font-size:22px;font-weight:700;text-align:center;line-height:1.7;margin:0}
.mascot-area{height:220px;position:relative}
.mascot-img{
  position:absolute;
  left:50%;
  top:18px;
  transform:translateX(-43%);
  width:238px;
  height:auto;
  object-fit:contain;
}
.home-input {
  cursor: text;
}
.home-input input {
  min-width: 0;
}
.home-input,.chat-input{
  display:flex;align-items:center;gap:8px;
  height:48px;border:1px solid #dedede;border-radius:24px;padding:0 8px 0 16px;background:#fff;
  box-shadow:0 7px 16px rgba(0,0,0,.05);
}
.home-input input,.chat-input input{border:0;outline:0;flex:1;font-size:14px;background:transparent}
.home-input button,.chat-input button{
  width:36px;height:36px;border-radius:50%;border:0;background:var(--yellow-2);display:grid;place-items:center;
}
.home-input button img,.chat-input button img{width:22px;height:22px}
.screen-title{display:flex;align-items:center;gap:14px;margin-top:8px}
.page-icon{width:42px;height:42px;object-fit:contain}
.screen-title h1{margin:0;font-size:28px}.screen-title p{margin:2px 0 0;color:#555;font-size:13px}

.steps-card {
  cursor: pointer;
}

.steps-sensor-status {
  margin: 2px 0 0;
  text-align: center;
  color: #9b7000;
  font-size: 10px;
  font-weight: 700;
}

.map-card {
  position: relative;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  height: calc(100dvh - 300px);
  min-height: 420px;
}

.leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.location-name {
  display: block;
  margin: 0 0 5px;
  text-align: center;
  color: #9b7000;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  min-height: 14px;
}

.location-status {
  margin: 14px 0 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf6;
  box-shadow: var(--shadow);
}

.location-status strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.location-status p {
  margin: 0;
  color: #666;
  font-size: 12px;
  line-height: 1.6;
}

.leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.route-card,
.route-note {
  z-index: 500;
}

.route-card{position:absolute;z-index:3;left:18px;right:18px;top:18px;height:52px;background:#fff;border-radius:18px;display:flex;align-items:center;gap:10px;padding:0 16px;box-shadow:var(--shadow)}
.route-card img{width:32px;height:32px}.route-card button{margin-left:auto;border:0;background:transparent;font-size:28px;color:#777}
.route-note{position:absolute;z-index:3;left:30px;top:86px;width:250px;display:flex;gap:10px;background:#fff;border-radius:16px;padding:12px;box-shadow:var(--shadow);font-size:12px}
.route-note img{width:34px;height:34px;object-fit:contain}
.route-note p{margin:3px 0 0;color:#555}
.map-api-area{position:absolute;inset:0;z-index:1;display:none}
.map-api-area iframe{width:100%;height:100%;border:0}
.map-svg{position:absolute;inset:0;display:block;width:100%;height:100%;z-index:1}
.map-card.using-api .map-svg{display:none}
.map-card.using-api .map-api-area{display:block}
.map-labels rect{fill:#fff;filter:drop-shadow(0 4px 8px rgba(0,0,0,.08))}
.map-labels text{font-size:14px;fill:#444;text-anchor:middle;font-weight:700}
.pin path{fill:#fff0bd;stroke:#f6b900;stroke-width:3}.pin text{fill:#f6b900;font-weight:900;text-anchor:middle;font-size:18px}
.camera-card{margin-top:10px;background:#fffdf5;border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:var(--shadow)}
.camera-card h1{font-size:20px;margin:0 0 14px;display:flex;align-items:center;gap:10px}
.camera-card h1 img{width:34px;height:34px}
.camera-image{width:100%;height:min(390px, calc(100dvh - 260px));border-radius:16px;object-fit:cover;background:#eee;display:block}
.camera-actions{height:62px;display:flex;align-items:center;gap:10px;justify-content:space-between}
.camera-actions span{font-size:13px}.camera-actions button,.save-link{border:1px solid #ddd;background:white;border-radius:20px;padding:8px 12px;color:#333;text-decoration:none;display:flex;align-items:center;gap:5px;font-size:14px}
.camera-actions img{width:19px;height:19px}
.notice{font-size:12px;color:#777;margin:0}
.empty-state{
  min-height:calc(100% - 58px);
  display:grid;
  place-items:center;
  align-content:center;
  gap:8px;
  text-align:center;
  color:#555;
}
.empty-state img{width:120px;height:auto;object-fit:contain}
.empty-state h1{font-size:22px;margin:0;color:#222}
.empty-state p{margin:0;line-height:1.8}
.chat-list{height:calc(100% - 58px);overflow:auto;padding-top:10px}
.chat-list:empty{display:none}
.message{display:grid;grid-template-columns:34px minmax(0,1fr) 38px;align-items:end;gap:8px;margin:16px 0}
.message.user{grid-template-columns:70px minmax(0,1fr);justify-items:end}
.message.user .bubble{grid-column:2;background:#fff;border:1px solid #ddd}.message.user time{grid-column:2;color:#aaa}
.avatar-small{width:32px;height:32px;border-radius:50%;object-fit:contain;background:var(--cream)}
.bubble{padding:12px 14px;border-radius:16px;background:#fff9e7;border:1px solid #f0d898;line-height:1.65;font-size:14px}
.message time{font-size:11px;color:#aaa}
.record-title{font-size:28px;margin:8px 0 4px}.record-sub{margin:0 0 20px;color:#555;font-size:13px}
.record-empty{min-height:60%}
.record-empty img{width:76px}
.tabbar{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  width:calc(100% - 28px);
  max-width:402px;
  bottom:calc(10px + env(safe-area-inset-bottom));
  height:64px;
  border:1px solid #ddd;
  border-radius:22px;
  background:#fff;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  overflow:hidden;
  z-index:10;
}
.tab{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#333;gap:3px;position:relative}
.tab img{width:27px;height:27px;object-fit:contain}.tab b{font-size:11px;font-weight:600}.tab.active{color:var(--yellow)}.tab.active:before{content:"";position:absolute;top:0;width:28px;height:3px;border-radius:2px;background:var(--yellow)}


/* ---- notification screen ---- */
.notification-button{
  position:relative;
}
.notification-badge{
  position:absolute;
  right:-2px;
  top:-2px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#ff4a2f;
  color:#fff;
  border:2px solid #fff;
  font-size:10px;
  font-weight:800;
  line-height:1;
}
.notification-head{
  display:grid;
  grid-template-columns:40px 1fr 52px;
  align-items:center;
  gap:8px;
  padding:8px 0 18px;
}
.notification-head h1{
  margin:0;
  font-size:28px;
  letter-spacing:.02em;
}
.notification-head p{
  margin:2px 0 0;
  color:#666;
  font-size:13px;
}
.back-button{
  width:38px;
  height:38px;
  border:1px solid #e9e9e9;
  border-radius:50%;
  background:#fff;
  color:#333;
  font-size:30px;
  line-height:1;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}
.text-button{
  border:0;
  background:var(--cream);
  color:#9b7000;
  border-radius:999px;
  padding:9px 12px;
  font-size:13px;
  font-weight:700;
}
.notification-list{
  display:grid;
  gap:12px;
  padding-bottom:18px;
}
.notification-list[hidden],
.notification-empty[hidden]{
  display:none;
}
.notification-item{
  display:grid;
  grid-template-columns:46px 1fr;
  gap:12px;
  align-items:start;
  padding:14px;
  border:1px solid #ececec;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,.04);
}
.notification-item.unread{
  border-color:#f5d37b;
  background:#fffdf6;
}
.notification-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--cream);
  color:var(--yellow);
  font-weight:900;
  font-size:20px;
}
.notification-meta{
  display:flex;
  gap:8px;
  align-items:center;
  color:#888;
  font-size:12px;
  margin-bottom:3px;
}
.notification-meta b{
  color:#ff6b00;
  font-size:11px;
}
.notification-item strong{
  display:block;
  font-size:15px;
}
.notification-item p{
  margin:4px 0 0;
  color:#666;
  font-size:13px;
  line-height:1.6;
}

/* ---- small layout tuning ---- */
.screen{
  padding-bottom:92px;
}
.chat-input{
  margin-top:8px;
}
.empty-state[hidden]{
  display:none;
}
