:root {
  --navy: #1f3a5f;
  --navy-2: #2d5487;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #667085;
  --line: #dde3ea;
  --ng: #b42318;
  --ng-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { height: 30px; width: auto; }
.app-name { font-weight: 700; color: var(--navy); font-size: 17px; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card.center { text-align: center; padding: 56px 24px; max-width: 560px; margin: 40px auto; }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.lead { font-size: 16px; margin: 0 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  font: inherit; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  padding: 8px 16px; font-weight: 600; transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.large { padding: 12px 28px; font-size: 16px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--navy); color: var(--navy); }

.hello { margin: 4px 0 24px; }
.hello p { margin: 0; }
.cat { margin-bottom: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; min-height: 92px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.tile:hover, .tile:focus-visible { border-color: var(--navy); transform: translateY(-1px); outline: none; }
.tile-name { font-weight: 700; color: var(--navy); font-size: 16px; }
.tile-name::after { content: " ↗"; font-weight: 400; color: var(--muted); font-size: 13px; }
.tile-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.note { margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); z-index: 20;
}
.toast.error { background: var(--ng); }

@media (max-width: 600px) {
  .topbar { padding: 8px 16px; }
  .app-name { font-size: 15px; }
  .grid { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
}
