:root {
  --shell-primary: #4285f4;
  --shell-primary-hover: #3367d6;
  --shell-success: #34a853;
  --shell-danger: #ea4335;
  --shell-danger-hover: #c5221f;
  --shell-warn: #fbbc04;
  --shell-bg: #f8f9fa;
  --shell-surface: #ffffff;
  --shell-text: #202124;
  --shell-text-muted: #5f6368;
  --shell-border: #dadce0;
  --shell-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shell-radius: 12px;
  --shell-header-height: 56px;
  --shell-tabs-height: 44px;
  --shell-footer-height: 48px;
  --shell-max-width: 95vw;
  --shell-font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.shell-body {
  font-family: var(--shell-font);
  color: var(--shell-text);
  background: var(--shell-bg);
  line-height: 1.6;
}

a {
  color: var(--shell-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-header {
  background: var(--shell-bg);
}

.shell-header__inner {
  max-width: var(--shell-max-width);
  margin: 0 auto 24px;
  min-height: var(--shell-header-height);
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--shell-primary);
}

.shell-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--shell-primary);
  white-space: nowrap;
}

.shell-title:hover {
  text-decoration: none;
  color: var(--shell-primary-hover);
}

.shell-refresh-button {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid var(--shell-primary);
  background: var(--shell-surface);
  color: var(--shell-primary);
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.shell-refresh-button:hover {
  background: rgba(66, 133, 244, 0.06);
}

.shell-refresh-button:focus-visible {
  outline: 2px solid var(--shell-primary);
  outline-offset: 2px;
}

.shell-tabs {
  background: var(--shell-bg);
}

.shell-tabs__scroll {
  max-width: var(--shell-max-width);
  margin: 0 auto;
  min-height: var(--shell-tabs-height);
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--shell-border);
}

.shell-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--shell-text-muted);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: 0.2s;
}

.shell-tab:hover {
  color: var(--shell-text);
  text-decoration: none;
}

.shell-tab.is-active {
  color: var(--shell-primary);
  border-bottom-color: var(--shell-primary);
}

.shell-main {
  flex: 1 1 auto;
  padding: 24px 0 32px;
}

.shell-main__inner {
  max-width: var(--shell-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.shell-panel__header {
  margin-bottom: 16px;
}

.shell-panel__title {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.shell-panel__lead {
  margin: 0;
  color: var(--shell-text-muted);
  font-size: 0.925rem;
}

.shell-panel__body {
  display: grid;
  gap: 16px;
}

.shell-card {
  background: var(--shell-surface);
  border-radius: var(--shell-radius);
  box-shadow: var(--shell-shadow);
  padding: 24px;
}

.shell-card__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.shell-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.shell-card__toolbar .shell-card__title {
  margin: 0;
}

.shell-card__value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--shell-text);
}

.shell-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.shell-muted {
  margin: 0;
  color: var(--shell-text-muted);
  font-size: 0.925rem;
}

.shell-footer {
  margin-top: auto;
  background: var(--shell-surface);
  border-top: 1px solid var(--shell-border);
}

.shell-footer__inner {
  max-width: var(--shell-max-width);
  margin: 0 auto;
  min-height: var(--shell-footer-height);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.shell-footer__link {
  font-weight: 600;
}

.shell-footer__muted,
.shell-footer__updated {
  color: var(--shell-text-muted);
}

.shell-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--shell-surface);
  color: var(--shell-text);
  transition: 0.2s;
}

.shell-button--primary {
  background: var(--shell-primary);
  color: #fff;
}

.shell-button--primary:hover {
  background: var(--shell-primary-hover);
}

.shell-button--ghost {
  border-color: var(--shell-border);
  background: var(--shell-surface);
}

.shell-button--ghost:hover {
  background: #f9fafb;
}

.shell-button--danger {
  background: var(--shell-danger);
  color: #fff;
}

.shell-button--danger:hover {
  background: var(--shell-danger-hover);
}

.shell-notifications {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.shell-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.shell-toast--success {
  background: var(--shell-success);
}

.shell-toast--error,
.shell-toast--danger {
  background: var(--shell-danger);
}

.shell-toast--warning {
  background: var(--shell-warn);
  color: var(--shell-text);
}

.shell-toast--info {
  background: var(--shell-primary);
}

.shell-toast__body {
  font-size: 0.9rem;
}

.shell-toast__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.shell-loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.85);
}

.shell-loading[hidden] {
  display: none !important;
}

.shell-loading__panel {
  min-width: 180px;
  padding: 24px 28px;
  border-radius: 10px;
  background: var(--shell-surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  text-align: center;
}

.shell-loading__spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border: 4px solid var(--shell-border);
  border-top-color: var(--shell-primary);
  border-radius: 50%;
  animation: shell-spin 1s linear infinite;
}

.shell-loading__text {
  margin: 0;
  font-weight: 600;
  color: var(--shell-text);
}

@keyframes shell-spin {
  to {
    transform: rotate(360deg);
  }
}

.shell-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
}

.shell-modal[hidden] {
  display: none !important;
}

.shell-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.shell-modal__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--shell-surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.shell-modal__dialog--sm {
  width: min(420px, 100%);
}

.shell-modal__header,
.shell-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.shell-modal__header {
  border-bottom: 1px solid var(--shell-border);
}

.shell-modal__footer {
  border-top: 1px solid var(--shell-border);
  justify-content: flex-end;
}

.shell-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--shell-primary);
}

.shell-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--shell-text-muted);
}

.shell-modal__body {
  padding: 20px;
}

.shell-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.shell-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--shell-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.shell-field__required {
  color: var(--shell-danger);
  margin-left: 2px;
}

.shell-field__control {
  width: 100%;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
}

.shell-field__control:focus {
  outline: none;
  border-color: var(--shell-primary);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.shell-field__help {
  margin: 0;
  font-size: 0.8rem;
  color: var(--shell-text-muted);
}

.shell-field__errors {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--shell-danger);
  font-size: 0.85rem;
}

.shell-field.has-error .shell-field__control {
  border-color: var(--shell-danger);
}

body.shell-is-loading {
  overflow: hidden;
}

@media (max-width: 900px) {
  .shell-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .shell-title {
    font-size: 18px;
  }

  .shell-header__inner {
    gap: 10px;
    padding: 16px;
  }

  .shell-refresh-button {
    padding: 8px 14px;
  }

  .shell-tabs__scroll,
  .shell-main__inner,
  .shell-footer__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .shell-tab {
    padding: 12px 14px;
  }

  .shell-card__toolbar {
    align-items: flex-start;
  }
}
