:root{
  --bg:#f4f7ff;
  --bg2:#edf2ff;
  --card:#ffffff;
  --text:#1c2440;
  --sub:#6d7896;
  --line:#dfe6ff;

  --blue1:#5b7cff;
  --blue2:#7a5cff;
  --cyan:#42c9ff;
  --green:#19c37d;
  --orange:#ff8a3d;
  --red:#ff5f6d;
  --yellow:#ffcf5a;

  --shadow:0 12px 30px rgba(84, 104, 255, 0.16);
}

*{
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
}

html, body{
  margin:0;
  padding:0;
  min-height:100%;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:linear-gradient(135deg,#f8fbff 0%, #fdf7ff 45%, #fffaf0 100%);
  color:var(--text);
}

body{
  padding:18px 14px 30px;
}

@media (min-width:700px){
  body{
    max-width:760px;
    margin:0 auto;
    padding:24px 18px 36px;
  }
}

h1,h2,h3,h4,p{
  margin:0;
  color:var(--text);
}

h1{
  font-size:28px;
  font-weight:900;
  margin-bottom:14px;
  text-align:center;
  padding:14px 18px;
  border-radius:18px;
  background:linear-gradient(135deg,#6ea8ff,#b388ff,#ff9ecf);
  color:#fff;
  box-shadow:0 8px 24px rgba(120,120,180,0.18);
}

h2{
  font-size:24px;
  font-weight:800;
  margin-bottom:14px;
  padding-left:10px;
  border-left:6px solid #8f7cff;
  color:var(--blue2);
}

h3{
  font-size:20px;
  font-weight:800;
  margin:0;
}

h4{
  font-size:16px;
  font-weight:800;
  margin-bottom:8px;
  color:var(--sub);
}

.container{
  max-width:980px;
  margin:0 auto;
  padding:16px;
}

.topCard{
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.35), transparent 35%),
    linear-gradient(135deg,var(--blue1),var(--blue2));
  color:#fff;
  border-radius:22px;
  padding:18px;
  margin-bottom:18px;
  box-shadow:0 16px 34px rgba(91,124,255,.28);
}

.topCard h3{
  color:#fff;
  font-size:24px;
  font-weight:900;
  margin-bottom:6px;
}

.topCard p{
  color:rgba(255,255,255,.92);
  font-size:14px;
}

#debug{
  background:#fff8d9;
  color:#7a6100;
  border:1px solid #ffe58a;
  border-radius:14px;
  padding:10px 12px;
  margin-bottom:14px;
  font-size:13px;
}

.card,
.product,
.support-detail-box{
  background:rgba(255,255,255,0.95);
  border:1px solid rgba(180,180,220,0.18);
  border-radius:18px;
  box-shadow:0 8px 24px rgba(120,120,180,0.10);
  padding:14px;
  margin-bottom:14px;
  backdrop-filter:blur(6px);
}

.product h3,
.card h3{
  color:#30305a;
}

.product p{
  color:var(--sub);
  line-height:1.55;
  margin-top:6px;
}

.price{
  display:inline-block;
  margin:8px 0 12px;
  padding:8px 14px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--orange),#ff6a3d);
  color:#fff;
  font-weight:900;
  font-size:16px;
  box-shadow:0 8px 18px rgba(255,138,61,.24);
}

.stock-badge,
.badge{
  display:inline-block;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  margin-bottom:10px;
}

.stock-ok{
  background:#e9fbf3;
  color:var(--green);
}

.stock-out{
  background:#fff0f3;
  color:var(--red);
}

.badge-pending{
  background:#fff7e8;
  color:#d97706;
}

.badge-done{
  background:#e9fbf3;
  color:var(--green);
}

.badge-cancel{
  background:#fff0f3;
  color:var(--red);
}

.qtyLabel,
.inputLabel{
  display:block;
  margin-top:12px;
  margin-bottom:6px;
  font-size:14px;
  font-weight:800;
  color:var(--sub);
}

input,
textarea,
select{
  width:100%;
  background:#ffffff;
  color:var(--text);
  border:2px solid var(--line);
  border-radius:16px;
  padding:13px 14px;
  font-size:15px;
  outline:none;
  transition:.15s ease;
}

input::placeholder,
textarea::placeholder{
  color:#98a5c6;
}

input:focus,
textarea:focus,
select:focus{
  border:2px solid var(--blue1);
  box-shadow:0 0 0 5px rgba(91,124,255,.16);
  background:#fff;
}

input,
textarea{
  caret-color:#ff3b3b;
}

textarea{
  min-height:120px;
  resize:vertical;
  line-height:1.45;
}

button{
  border:none;
  border-radius:14px;
  background:linear-gradient(135deg,#6ea8ff,#8f7cff);
  color:#fff;
  padding:10px 14px;
  font-size:15px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(110,140,255,.20);
  transition:transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(110,140,255,.25);
}

button:active{
  transform:translateY(0);
  opacity:.92;
}

button.secondary{
  background:linear-gradient(135deg,#7ed6a7,#46c2a8);
  color:#fff;
}

button.success{
  background:linear-gradient(90deg,#20c997,#14b86f);
  color:#fff;
  box-shadow:0 10px 22px rgba(25,195,125,.22);
}

button.danger{
  background:linear-gradient(135deg,#ff7b8a,#ff5fa2);
  color:#fff;
}

button[disabled]{
  background:#d8dff4;
  color:#7d89a8;
  box-shadow:none;
}

.fakeBtn{
  display:inline-block;
  text-decoration:none;
  border:none;
  border-radius:16px;
  padding:12px 16px;
  font-size:15px;
  font-weight:900;
  cursor:pointer;
  margin-top:10px;
}

.fakeBtn.secondary{
  background:linear-gradient(90deg,#eef3ff,#dde6ff);
  color:#7a5cff;
  box-shadow:none;
}

.fakeBtn:visited{
  color:#7a5cff;
}

.fakeBtn:hover{
  opacity:.95;
}

.qtyBox{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin:10px 0 14px;
}

.qtyBox button{
  width:42px;
  height:42px;
  padding:0;
  border-radius:14px;
  background:linear-gradient(180deg,var(--orange),#ff6c3f);
  color:#fff;
  font-size:24px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(255,138,61,.24);
}

.qtyBox span{
  min-width:54px;
  text-align:center;
  font-size:20px;
  font-weight:900;
  color:var(--text);
  background:#f7f9ff;
  border:2px solid var(--line);
  border-radius:14px;
  padding:8px 10px;
}

.totalPrice{
  margin:10px 0 14px;
  padding:10px 12px;
  border-radius:14px;
  background:linear-gradient(90deg,#fff7e8,#fff1d6);
  color:#d97706;
  font-weight:900;
  font-size:16px;
  border:1px solid #ffd89a;
}

.btnRow,
.actions,
.toolbar,
.tabs,
.kana-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.btnRow{
  margin-top:12px;
  position:relative;
  z-index:10;
}

.empty{
  text-align:center;
  background:linear-gradient(135deg,#f4f7ff,#fbf3ff);
  color:#666;
  border:2px dashed #d9e2ff;
  border-radius:20px;
  padding:26px 16px;
  font-weight:700;
}

.salesBox{
  display:grid;
  gap:10px;
}

.salesItem{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  box-shadow:var(--shadow);
  color:var(--sub);
}

.salesItem strong{
  display:block;
  margin-top:6px;
  font-size:22px;
  color:var(--blue2);
}

.mainTabs{
  margin-bottom:18px;
}

.subTabs{
  margin-bottom:14px;
}

.tabBtn,
.tab-btn{
  background:linear-gradient(135deg,#c7d2ff,#e0c3ff);
  color:#35345a;
  box-shadow:none;
  margin-top:0;
  border-radius:999px;
  padding:10px 14px;
}

.tabBtn.active,
.tab-btn.active{
  background:linear-gradient(135deg,#6ea8ff,#b388ff);
  color:#fff;
  box-shadow:0 8px 18px rgba(120,120,180,0.18);
  font-weight:800;
}

.tab-content{
  display:none;
}

.tab-content.active{
  display:block;
}

.accountsBox{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.editorBox{
  display:flex;
  border:2px solid var(--blue1);
  border-radius:16px;
  overflow:hidden;
  margin-top:10px;
  background:#fff;
}

.lineNumbers{
  background:#eef3ff;
  padding:10px 8px;
  text-align:right;
  color:#6d7896;
  font-size:13px;
  user-select:none;
  min-width:42px;
}

.lineNumbers div{
  height:20px;
  line-height:20px;
}

.editorBox textarea{
  flex:1;
  border:none;
  border-radius:0;
  padding:10px 12px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:14px;
  line-height:20px;
  background:#fff;
  color:var(--text);
  box-shadow:none;
}

.editorBox textarea:focus{
  border:none;
  box-shadow:none;
  background:#fff;
}

.support-detail-box{
  margin-top:20px;
}

.small{
  font-size:12px;
  opacity:.7;
  margin-top:6px;
  color:#6d6d8a;
}

.admin-msg{
  border-left:4px solid #888;
}

.user-msg{
  border-left:4px solid #444;
}

.unread-badge{
  display:inline-block;
  margin-left:8px;
  padding:5px 9px;
  border-radius:999px;
  background:linear-gradient(135deg,#ffcc70,#ff9f68);
  color:#6b3b00;
  font-size:12px;
  font-weight:800;
}

.unread-card{
  border:2px solid #ffb86b;
  box-shadow:0 8px 24px rgba(255,175,90,0.18);
}

.paypay-box{
  margin:10px 0 12px;
  padding:12px;
  border-radius:14px;
  background:linear-gradient(90deg,#f8faff,#eef3ff);
  border:1px solid var(--line);
}

.paypay-link-text,
.paypay-pass-text{
  margin-top:6px;
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
  word-break:break-all;
  line-height:1.5;
}

/* カテゴリ見出し */
.categoryTitle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:70px;
  margin:0;
  padding:0 14px;
  text-align:center;
  font-size:20px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,#6ea8ff,#9f7bff,#ff7fd3);
  border-radius:16px;
  box-shadow:0 6px 14px rgba(0,0,0,0.12);
}

/* カテゴリを押すボタン */
.category-toggle-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:0;
  min-height:70px;
  background:none !important;
  border:none;
  box-shadow:none !important;
  margin-top:0;
}

.category-group-card{
  text-align:center;
}

.category-group-card{
  text-align:center;
}

.actions button{
  min-height:auto;
  width:auto;
  padding:10px 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#6ea8ff,#8f7cff) !important;
  color:#fff !important;
  box-shadow:0 6px 16px rgba(110,140,255,.20) !important;
}

.actions button.danger{
  background:linear-gradient(135deg,#ff7b8a,#ff5fa2) !important;
  color:#fff !important;
}

.actions button.secondary{
  background:linear-gradient(135deg,#7ed6a7,#46c2a8) !important;
  color:#fff !important;
}