:root {
  --bg: #f5f2eb;
  --surface: #ffffff;
  --border: #e0d9cc;
  --text: #2c2820;
  --muted: #7a7368;
  --accent: #4a6b4e;
  --danger: #9c4a3c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif, system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

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

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* iOS は 16px 未満の入力欄にフォーカスするとズームする */
button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  color: inherit;
}

button {
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.xs {
  font-size: 0.75rem;
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
}

.page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.card {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card h2 {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.section-title {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 1rem;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.85;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.field {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  outline: none;
}

.field:focus {
  border-color: var(--accent);
}

/* ログイン */

.login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 20rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  text-align: center;
}

.login h1 {
  font-size: 1.125rem;
  font-weight: 500;
}

.login form {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.pin {
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.5em;
}

.pin::placeholder {
  letter-spacing: normal;
}

/* ローンチャー */

.launcher {
  padding: 2.5rem 1.5rem 4rem;
}

.launcher header {
  margin-bottom: 2.5rem;
}

.launcher-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.125rem;
}

.launcher h1 {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem 0.5rem;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.tile-icon {
  display: flex;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.25rem;
  transition: transform 0.15s;
}

.tile:active .tile-icon {
  transform: scale(0.95);
}

.tile-name {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.025em;
}

/* アプリ共通ヘッダー */

.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.app-header a {
  font-size: 0.875rem;
  color: var(--muted);
}

.app-header h1 {
  font-size: 0.875rem;
  font-weight: 500;
}
