/* EXCEED タイムカード「スカイポップ」 — design/design-tokens.json 準拠 */
:root {
  --tc-page: #eaf2fb;
  --tc-app: #eef5ff;
  --tc-primary: #4f7ff7;
  --tc-secondary: #91cdf5;
  --tc-text: #29273b;
  --tc-muted: #9b97a6;
  --tc-card: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.tc-page {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--tc-page);
  color: var(--tc-text);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

.tc-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--tc-app);
}

.tc-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 17px;
  border-bottom: 1px solid rgba(44, 40, 61, .07);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
}

.tc-brand { display: flex; align-items: center; gap: 10px; }
/* EXCEEDのロゴマーク。白地の角丸に載せて、既存の立体感（下方向の影）を保つ */
.tc-brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #fff;
  object-fit: contain;
  border: 1px solid rgba(50, 95, 180, .12);
  box-shadow: 0 4px 0 #d6e6ff;
}
.tc-brand > span:last-child { display: flex; flex-direction: column; }
.tc-brand small { color: var(--tc-primary); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.tc-brand strong { margin-top: 2px; font-size: 13px; }
.tc-hello { color: var(--tc-primary); font-size: 10px; font-weight: 900; letter-spacing: .13em; }

.tc-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(38, 35, 54, .09);
  border-radius: 14px;
  background: #fff;
  color: #696674;
  box-shadow: 0 3px 0 rgba(44, 40, 61, .09);
}
.tc-icon-button svg { width: 19px; height: 19px; }
.tc-icon-button i { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #ff716a; }

.tc-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 17px calc(102px + env(safe-area-inset-bottom));
}
.tc-greeting small { color: var(--tc-primary); font-size: 12px; font-weight: 800; }
.tc-greeting h1 { margin: 6px 0 4px; font-size: clamp(20px, 5.3vw, 23px); line-height: 1.32; letter-spacing: -.035em; }
.tc-greeting p { margin: 0; color: #8e8a99; font-size: 12px; }

.tc-time-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 360px;
  margin-top: 20px;
  padding: 19px 16px;
  border: 1px solid rgba(50, 95, 180, .08);
  border-radius: 26px;
  background: var(--tc-card);
  box-shadow: 0 7px 0 #d6e6ff, 0 16px 30px rgba(56, 101, 184, .1);
}

.tc-card-head { display: flex; align-items: center; justify-content: space-between; align-self: stretch; }
.tc-card-head > span:first-child { color: #aaa5b7; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.tc-status { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.tc-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent); }
.tc-status-idle { background: #efedf3; color: #878391; }
.tc-status-working { background: #daf7eb; color: #198667; }
.tc-status-done { background: #e6edff; color: #4065c8; }

.tc-time-card > time { margin-top: 44px; font-size: clamp(43px, 12vw, 52px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.06em; }
.tc-time-caption { margin: 9px 0 26px; color: var(--tc-muted); font-size: 12px; }

.tc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; width: 100%; }
.tc-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  min-height: 72px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(47, 40, 76, .15);
  transition: transform .14s ease, box-shadow .14s ease;
}
.tc-action svg { width: 21px; height: 21px; }
.tc-action-in { background: var(--tc-primary); color: #fff; }
.tc-action-out { background: var(--tc-secondary); color: #174d72; }
.tc-action:disabled { background: #efedf2; color: #aaa6b2; box-shadow: 0 4px 0 #dedbe4; cursor: default; }
.tc-action:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(47, 40, 76, .18); }

.tc-gps-note { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 17px; padding: 10px; border-radius: 11px; background: #eef5ff; color: #4973c4; font-size: 12px; font-weight: 700; }
.tc-gps-note svg { width: 16px; height: 16px; flex: none; }
.tc-message { min-height: 34px; margin: 9px 0 0; color: #4973c4; font-size: 12px; text-align: center; line-height: 1.45; }
.tc-message.tc-message-error { color: #d64550; }

.tc-record-card { margin-top: 18px; padding: 17px; border: 1px solid rgba(58, 50, 89, .08); border-radius: 22px; background: rgba(255, 255, 255, .9); box-shadow: 0 5px 0 rgba(73, 60, 119, .08); }
.tc-section-head { display: flex; align-items: start; justify-content: space-between; }
.tc-section-head small { color: var(--tc-primary); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.tc-section-head h2 { margin: 3px 0 0; font-size: 16px; }
.tc-section-head > svg { width: 21px; height: 21px; color: var(--tc-primary); }
.tc-records { display: flex; flex-direction: column; gap: 12px; margin-top: 13px; }
.tc-record { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.tc-record > i { width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--tc-primary); box-shadow: 0 0 0 2px rgba(79, 127, 247, .2); }
/* 打刻場所（「事務所付近」など）は種別の下に小さく添える */
.tc-record-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tc-record-label small { color: var(--tc-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-record strong { font-variant-numeric: tabular-nums; }
.tc-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 0; color: #aaa6b2; font-size: 12px; }
.tc-empty svg { width: 17px; height: 17px; }

.tc-bottom-nav {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 70px;
  padding: 8px 4px;
  border: 1px solid rgba(42, 58, 91, .09);
  border-radius: 22px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 28px rgba(38, 52, 80, .14);
  backdrop-filter: blur(16px);
}
.tc-bottom-nav button { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-width: 44px; border: 0; background: transparent; color: #9b98a5; font: inherit; font-size: 10px; font-weight: 700; }
.tc-bottom-nav button svg { width: 20px; height: 20px; }
.tc-bottom-nav button.is-active { color: var(--tc-primary); }
.tc-bottom-nav button:disabled { opacity: .43; }
.tc-bottom-nav button i { position: absolute; top: -4px; right: 2px; padding: 2px 4px; border-radius: 4px; background: #eceaf0; color: #888591; font-size: 7px; font-style: normal; }

button:focus-visible { outline: 3px solid rgba(79, 127, 247, .42); outline-offset: 3px; }
input:focus-visible { outline: 3px solid rgba(79, 127, 247, .42); outline-offset: 1px; }

/* ---- ログイン画面 ---- */
.tc-login-page {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 17px;
  background: var(--tc-page);
  color: var(--tc-text);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
.tc-login-card {
  width: min(100%, 400px);
  padding: 30px 24px;
  border: 1px solid rgba(50, 95, 180, .08);
  border-radius: 26px;
  background: var(--tc-card);
  box-shadow: 0 7px 0 #d6e6ff, 0 16px 30px rgba(56, 101, 184, .1);
}
.tc-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.tc-login-brand .tc-brand-mark { width: 48px; height: 48px; font-size: 23px; border-radius: 15px; }
.tc-login-brand small { display: block; color: var(--tc-primary); font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.tc-login-brand strong { display: block; margin-top: 2px; font-size: 17px; }
.tc-login-card label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: #6d6a7c; }
.tc-login-card input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(50, 95, 180, .18);
  border-radius: 14px;
  background: #f7faff;
  color: inherit;
  font: inherit;
  font-size: 16px; /* iOSのズーム防止で16px以上 */
}
.tc-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  border: 0;
  border-radius: 18px;
  background: var(--tc-primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(47, 40, 76, .15);
  transition: transform .14s ease, box-shadow .14s ease;
}
.tc-login-submit:disabled { background: #efedf2; color: #aaa6b2; box-shadow: 0 4px 0 #dedbe4; cursor: default; }
.tc-login-submit:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(47, 40, 76, .18); }
.tc-login-message { min-height: 18px; margin: 12px 0 0; color: #d64550; font-size: 12px; text-align: center; }
.tc-login-note { margin: 18px 0 0; color: var(--tc-muted); font-size: 11px; text-align: center; }
.tc-login-note code { display: inline-block; padding: 2px 6px; border-radius: 6px; background: #f0f4fb; color: #4973c4; font-size: 11px; word-break: break-all; }
.tc-login-step { margin: 4px 0 12px; color: #6d6a7c; font-size: 13px; line-height: 1.6; }
.tc-login-qr { display: flex; justify-content: center; margin: 10px 0; }
.tc-login-qr svg { width: 180px; height: 180px; border: 1px solid rgba(50, 95, 180, .15); border-radius: 12px; background: #fff; padding: 8px; }
.tc-login-recovery { padding: 12px 16px; border-radius: 12px; background: #f0f4fb; color: #29273b; font-size: 14px; line-height: 1.9; font-family: ui-monospace, Consolas, monospace; user-select: all; }

/* ---- 管理画面（最小限） ---- */
.tc-admin { max-width: 760px; margin: 0 auto; padding: 24px 17px 60px; }
.tc-admin h1 { font-size: 20px; }
.tc-admin section { margin-top: 20px; padding: 17px; border: 1px solid rgba(58, 50, 89, .08); border-radius: 22px; background: #fff; box-shadow: 0 5px 0 rgba(73, 60, 119, .08); }
.tc-admin h2 { margin: 0 0 12px; font-size: 15px; }
.tc-admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tc-admin th, .tc-admin td { padding: 8px 6px; border-bottom: 1px solid rgba(58, 50, 89, .08); text-align: left; }
.tc-admin input { min-height: 40px; padding: 6px 10px; border: 1px solid rgba(50, 95, 180, .18); border-radius: 10px; background: #f7faff; font: inherit; font-size: 14px; }
.tc-admin button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 12px; background: var(--tc-primary); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 rgba(47, 40, 76, .15); }
.tc-admin button.tc-admin-sub { background: #eef5ff; color: #4973c4; }
.tc-admin .tc-admin-msg { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: #4973c4; }
.tc-admin .tc-admin-msg.is-error { color: #d64550; }
.tc-admin form.tc-admin-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- レスポンシブ ---- */
@media (min-width: 700px) {
  .tc-page { padding: 24px; }
  .tc-app { height: calc(100vh - 48px); height: calc(100dvh - 48px); max-height: 900px; border-radius: 32px; box-shadow: 0 24px 65px rgba(36, 52, 80, .18); }
}

@media (max-width: 360px) {
  .tc-header { gap: 7px; padding-inline: 13px; }
  .tc-hello { display: none; }
  .tc-main { padding-inline: 14px; }
  .tc-time-card > time { font-size: 41px; }
  .tc-gps-note { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
